Umbraco tip of the week: Redirects

Sunday, June 28, 2009 by Sebastiaan Janssen

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!

Share this post:

| More

4 comment(s) for “Umbraco tip of the week: Redirects”

  1. Gravatar of Søren Sprogø
    Søren Sprogø Says:
    What type of redirect does umbracoRedirect do?
  2. Gravatar of Søren Sprogø
    Søren Sprogø Says:
    To answer my own question:

    umbracoRedirect is doing a 302 temporary redirect.
  3. Gravatar of Sebastiaan
    Sebastiaan Says:
    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.
  4. Gravatar of Laurence
    Laurence Says:
    interesting tip!
    thanks! (: lau

Leave comment:

Name (required):
E-mail (required, used to get your Gravatar):
Website:
Comment (required):
To make sure that you are human, please enter
both words below (required):