Umbraco tip of the week: Redirects
So you start out building your website without knowing exactly what you are doing. You add new nodes under "Content" and it looks nice, but then you try adding navigation...
The default XSLT navigation templates only work when you add a node under "Content" and then all of your content under that. Luckily, it's easy enough to move all your content under a new item. But what should that item be?
I tend to start with a document type of "RedirectFolder", for example this is what my content section looks like right now:
The documentType contains two properties of the type "contentPicker" and their aliases are umbracoRedirect and umbracoInternalRedirectId. Once you pick a page, the redirecting will be done automagically by Umbraco.
The umbracoInternalRedirectId property kind of does what it says: it will load the selected page's content transparently; no url change. Thanks to Doug Robar for telling us about this hidden gem at CodeGarden '09!
6 comments on this article
Søren Sprogø | June 29 2009 09:27
What type of redirect does umbracoRedirect do?
Søren Sprogø | June 29 2009 16:04
To answer my own question:
umbracoRedirect is doing a 302 temporary redirect.
Sebastiaan | June 29 2009 17:12
Thanks Søren! Obviously the internal redirect doesn't do a redirect at all, so there's no problem there.
Maybe instead of the umbracoRedirect, it is better to use the umbracoUrlAlias.
For search engines it would be better if the umbracoRedirect used a 301.
Laurence | June 28 2009 16:44
interesting tip!
thanks! (: lau
Kenneth Solberg | December 21 2011 15:24
This technique is quite handy in multilingual sites as well where you have your usual language spesific branches such as /de, /en, /fr etc. and use the root node with internalRediredtId to point to the default language. Removes the need for a global landing page.
Guido Adam | February 13 2012 15:49
Anyone know how to Redirect Internal in Umbraco 5?