Adding Redirects to a Website

Because a single installation of SetSeed powers multiple websites, it's not practical to add server redirects into an .htaccess file in the public folder (this file will be replaced when you update to a newer version so changes to it should be avoided). Instead SetSeed has a site by site method of adding redirects for pages.

To create redirects for a site, add a file called redirects.xml in your site's folder, not inside the theme folder like other files in this guide, but in fact alongside it. It will be alongside the 'themes' folder as well as the 'images', 'media' folders etc.

You can then add redirects from one page to another in this file. This is useful if your client wants to rename an important page and want to maintain that page's seo ranking by forwarding it to the new page. This is an example of the file:

<?xml version="1.0"?>
<redirects>
<redirect>
<type>301</type>
<source>/old-page/</source>
<destination>/new-page/</destination>
</redirect>
<redirect>
<type>301</type>
<source>/another-old-page.html</source>
<destination>http://another-site.com/new-page.html</destination>
</redirect>
</redirects>

Please note: Source values ending without an extension should always include the trailing slash, as in the example above. Even if on a previous site a trailing slash wasn't used.

As you can see a redirect is added by adding a <redirect> element in the XML. The 'source', 'type' (only supports 301 currently), 'destination' can then be added in nested elements. The destination can either be another page on the site, or a link to a different site altogether.

Remember, if you change this file, delete the site's template cache to make sure SetSeed uses the redirect instead of a cache file for a URL (cache files are the first thing SetSeed will try and show, to ensure a cache file is shown as quickly as possible).

Search