Version 4 > User Guides > Redirects

Redirects

The CMS allows you to handle redirects as if they were regular content. Redirects are useful for

  • content that has been deleted; you can maintain the original URL and automatically redirect it somewhere more appropriate
  • content that has been moved or renamed; you can automatically catch visits to the old URL, and redirect them to the new URL
  • setting up alt URLs for special events or promotions; these will automatically redirect to the proper URL

Redirects have two important attributes:

  • from URL: this is the URL that visitors will be using, representing the old, deleted, or alternative URL
  • to URL: this is the proper URL that those visitors will be sent to

Redirects are simple to configure; there are only four settings that matter:

  • type = redirect
  • name = friendly URL element
  • parent = [parent content ID]
  • original/master = [destination content ID]

The parent+name will determine the from URL. For example, if the parent is the website section, and name is "from-url", then the from URL will be something like https://foo.com/from-url. If you are working from a content object that has been deleted or moved, you can simply replace the original content object with your redirect; if it has the same parent+name as the original, then the redirect will be situated at the original URL.

The original/master content determines the to URL. If you are redirecting to another page on your site, this should simply point to that content ID. It is possible to redirect off-site by directing to a content object that has a special URL defined.

The method of redirection depends whether you are visiting a static or dynamic URL. Static URLs use a meta-refresh header to send the visitor to the new URL. Dynamic URLs use a 301 Moved HTTP status header. If you want to use a 301 status header on a static URL, you will have to add a line to your website's httpd.conf file like

Redirect 301 /old-url https://foo.com/new-url

If you preview your redirect content in SystemBrowser, it will give you the precise syntax for this redirect directive.