From 667e11c4ec3835d959aab1797647bd0a49869674 Mon Sep 17 00:00:00 2001 From: etienne Date: Tue, 21 Oct 2014 23:35:24 +0200 Subject: Init commit --- content/extras/aliases.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 content/extras/aliases.md (limited to 'content/extras/aliases.md') diff --git a/content/extras/aliases.md b/content/extras/aliases.md new file mode 100644 index 0000000..1822135 --- /dev/null +++ b/content/extras/aliases.md @@ -0,0 +1,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, there's 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.* -- cgit v1.3