Cultiv Web Solutions

Umbraco tip of the week: Redirects

Umbraco tip of the week: Redirects 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 ) 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:

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!

 

6 comments on this article

Avatar for Søren Sprogø Comment from Søren Sprogø
What type of redirect does umbracoRedirect do?

Avatar for Søren Sprogø Comment from Søren Sprogø
To answer my own question:

umbracoRedirect is doing a 302 temporary redirect.

Avatar for Sebastiaan Comment from Sebastiaan
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 Comment from Laurence
interesting tip!
thanks! (: lau

Avatar for Kenneth Solberg Comment from Kenneth Solberg
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 Comment from Guido Adam
Anyone know how to Redirect Internal in Umbraco 5?

Add your comment