Umbraco tip of the week: Redirects

Note: this post is over a year old, it's very likely completely outdated and should probably not be used as reference any more. You have been warned. :-)

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:

redirectfolder

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!

Sebastiaan Janssen

Dutch guy living in (and loving) Copenhagen, working at Umbraco HQ. Lifehacker, skeptic, music lover, cyclist, developer.

 

6 comments on this article

Avatar for Søren Sprogø Søren Sprogø | June 29 2009 09:27
What type of redirect does umbracoRedirect do?

Avatar for Søren Sprogø Søren Sprogø | June 29 2009 16:04
To answer my own question:

umbracoRedirect is doing a 302 temporary redirect.

Avatar for Sebastiaan 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.

Avatar for Laurence Laurence | June 28 2009 16:44
interesting tip!
thanks! (: lau

Avatar for Kenneth Solberg 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.

Avatar for Guido Adam Guido Adam | February 13 2012 15:49
Anyone know how to Redirect Internal in Umbraco 5?