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
What type of redirect does umbracoRedirect do?
To answer my own question:\u003Cbr /\u003E\u003Cbr /\u003EumbracoRedirect is doing a 302 temporary redirect.
Thanks S\u00F8ren! Obviously the internal redirect doesn\u0027t do a redirect at all, so there\u0027s no problem there.\u003Cbr /\u003E\u003Cbr /\u003EMaybe instead of the umbracoRedirect, it is better to use the umbracoUrlAlias.\u003Cbr /\u003E\u003Cbr /\u003EFor search engines it would be better if the umbracoRedirect used a 301.
interesting tip!\u003Cbr /\u003Ethanks! (: lau
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.
Anyone know how to Redirect Internal in Umbraco 5?