Background Color:
 
Background Pattern:
Reset
Search

Articles & Service Announcements

Wednesday, May 14, 2014

How to preserve legacy URLs after moving site content to DNN platform

In this article we discuss a strategy of preserving existing legacy URLs when converting to DNN platform in order to avoid nasty 404 errors.

One of our customers has recently inquired with a question regarding URL redirection. Basically, in his case the original site was not a DNN site and he had bunch of .htm and .asp files that made up the original site. Once he moved his content to the DNN platform the URL structure had changed and he wanted to redirect his old URLs to the new DNN pages in order to preserve search engine ranking and legacy links from other sites that are not likely to update often.


There are several ways to implement this kind of automatic redirection. A simple way of achieving this effect is to replace the standard “404 Page Not Found” with an ASP or ASP.NET page using the custom redirection logic where you can use series of “If … Then Response.Redirect(“..”)” or other intricate regular expression pattern matching methods. In essence, all the methods examine what the URL browser has requested from the server and forces the server to respond back with the "301" redirect to the client browser with a valid new URL. There is a more elegant way to handle this situation if you are using DNN. The key is siteurls.config file located in the DNN installation root directory. In addition, the rudimentary understanding of the Regular Expressions can be useful when dealing with this issue. The siteurls.config file contains XML blocks that define rules for translating the requested URL to the URL you want the client browser or search engine spider to hit.

<RewriterRule> 

<LookFor>*/acme_content(.*)</LookFor> 

<SendTo>~/SomeValidDNN-URL/</SendTo>

</RewriterRule>

By correctly using regular expressions you can redirect multiple old URLs to a specific URL on your new DNN page, or you can setup < RewriterRule>…</RewriterRule> XML block for every page on your old site to a corresponding new URL. By correctly translating old website URLs to the new URL structure you can make the transition to DNN completely transparent for your visitors. Also, you will likely preserve your Google ranking and will expedite the re-indexing process for your new site while ensuring inbound links to your old site structure are functioning and are preserved.

 

Please login or register to post comments.