开发者

How to set up 301 redirects in Kentico CMS

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 docume开发者_JS百科nt 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?


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.


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.


I would install the IIS Rewriter module http://www.iis.net/downloads/microsoft/url-rewrite Then I would add a rule (permanent = 301) for all the .cfm pages to be processed by a custom handler.

For the customer I have to create a custom table with two columns that holds the relation between the old links and the new links.

That custom handler will then look into the custom table for any matches and then do the correct redirection.


I have implemented it in IIS6 for several clients moving from a php system to kentico using ISAPI Rewrite from Helicon (http://www.helicontech.com/isapi_rewrite/). It uses a .htaccess file at the root of the site. You could make this an edittable page from kentico if you needed to, or updatable from a custom field in page if you needed to, however we just got mapping list from our clients.

I believe you can do the same thing natively in IIS7 with one of the optional plugins.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜