301 Redirects in Kentico CMS

by Jeff Steil on July 30, 2015

301 Redirects in Kentico CMS

On any website redesign, many of the old page urls will be changing on the new website. Rather then displaying a page not found for the old page, it is better to do a permanent redirect (301) to the new page for SEO.

There are a few different ways to redirect old, obsolete pages to a new url within IIS (including HTTP Redirect and the URL Rewrite module) but if you have a relatively small number of simple redirects (i.e. /page1.php > /page1) it often can be easier just to do the redirection within Kentico.

Modifying web.config to Allow Kentico to Handle Redirection
The web.config file must be changed to allow Kentico handle all requests for the website.

1.  Add runAllManagedModulesForAllRequests="true" to the modules element under system.webServer.

Setting up Redirection in Kentico
Kentico must be configured to properly redirect aliases.

1.  Go to Configutation > Settings > URLs and SEO
2.  Check the Allow permanent (301) redirection checkbox under the Search engine optimization (SEO) section.

3.  Check the Redirect page aliases to to main URL checkbox under the SEO - URLs section.

Setting up Redirection for a Page
Now that the web.config and Kentico have both been modified to support redirection, you can add redirections to any page on your website.

1.  Go to Content > Pages and select the page you want to add a redirection to.

2.  Go to the URLs tab and click on Add new alias.

3.  Add a new alias where the Path or pattern is the old page and URL extensions is the old page extension (if it had one).  In this example, we are specifying that any requests to /outcomes.php should be redirected to /outcomes.

4.  The new alias has been added and any requests to /outcomes.php will be redirected to /outcomes.

One issue that you might run into is when an alias is already defined for the main url that matches your new path.

1.  For example, if the main url is /outcomes and there is an alias defined that is also /outcomes, any redirects that you add that have /outcomes in them (i.e. /outcomes.php) will not work.

2.  You will need to delete the /outcomes alias in this example for /outcomes.php to redirect correctly.

#configuration #redirection

Blog post currently doesn't have any comments.
 Security code