Welcome to mirror list, hosted at ThFree Co, Russian Federation.

aliases.md « extras « content « docs - github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0bf0e6c290121e9425ec40768eaf8770c1bc3dc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
aliases:
- /doc/redirects/
- /doc/alias/
- /doc/aliases/
date: 2013-07-09
menu:
  main:
    parent: extras
next: /extras/builders
prev: /taxonomies/ordering
title: Aliases
weight: 10
---

For people migrating existing published content to Hugo theres a good chance
you need a mechanism to handle redirecting old urls.

Luckily, this can be handled easily with aliases in Hugo.

## Example
**content/posts/my-awesome-blog-post.md**

    ---
    aliases:
        - /posts/my-original-url/
        - /2010/even-earlier-url.html
    ---

Now when you go to any of the aliases locations they
will redirect to the page.

## Important Behaviors

1. *Hugo makes no assumptions about aliases. They also don't change based
on your UglyUrls setting. You need to provide absolute path to your webroot and the
complete filename or directory.*

2. *Aliases are rendered prior to any content and will be overwritten by
any content with the same location.*