tags:

views:

126

answers:

2

How would you approach setting up 301 redirects within Kentico CMS (v5.0)?

I want to provide a client with an easy way (ideally through the CMS Desk interface) to set up 301 redirects in a website that has recently be re-implemented on Kentico. For example, I would want to redirect "old-page.cfm" to "new-page.aspx", and ensure that the HTTP response to the original request is 301.

I have an approach that looks like it works, but maybe there is a better way. I configured extensions-less URLs (per Kentico's documentation) and added a new document alias to the "new-page" document, specifying the "old-page" as the URL path and adding ".cfm" to the URL extensions list. Using Fiddler (HTTP Debugging Proxy) tool, it looks like what I want to have happen is happening: the request for "old-page.cfm" is returning a 301, redirecting to the "new-page" document, and returning a 200 response.

Does anyone know if this is a good approach for setting up 301 redirects in Kentico? Is there a better way? Are there any known drawbacks to using extension-less URLs in Kentico?

A: 

I think this is a good approach and I'm not aware of any other way to accomplish 301 redirects without doing what your doing. I've used Extension-less URLs in Kentico for awhile now and they work well.

Mcbeev
Yes, this seems to be working well so far. Before taking this approach, I had prototyped a solution that entailed intercepting the request in the Application_BeginRequest event and looking for a matching legacy URL stored in a custom table. This worked well also, and doesn't require extensionless URLs.
jmcdowell
A: 

According to a Blog Post (Comment) by the CTO of Kentico:

... there are few new (so far experimental) settings in 4.0 (4.0 ONLY) you can put in the web.config file.

They are:

3) <add key="CMSUsePermanentRedirect" value="true" /> which allows 301 redirection in places where it makes sense, instead of 302 redirection.

2) <add key="CMSRedirectAliasesToMainURL" value="true" /> which you can use for better SEO. It does 301 on every URL which is not main for the document (NodeAliasPath). That should help you for now.

3) <add key="CMSRedirectInvalidCasePages" value="true" /> which goes even further and allows you to restrict the pages only to a specific case variant. When the case is not right, it gets 301 to the right case.

I'm not sure what the status of these are with 5.X, but I'm guessing they either work, or they are now configuration settings somewhere in the Site Manager.

SkippyFire