Redirect old page to new page with use of web.config

July 4, 2011 at 9:36 am Leave a comment

Recently we found that some of our old links were broken as we have changed our page name to make it seo friendly. Suddenly, over the night our site’s page rank was down. It was really embarrassed situation for all of us.

There were below reason for it.

As we have moved our server from linux to windows platform and there were no idea of page rename, and lack of technical availability to use htaccess redirection in windows platform.

After some work around it, finally I came across following things which is very good and needs to use when we rename any page and don’t want old link should be break.

Here, please not that following things will work on IIS 7.0+

First block will resolve canonical issue of prefix www before any domain name.

Second block will redirect my old page link to new mapped page.

<rule name=”Redirect to WWW” stopProcessing=”true”>

<match url=”.*” />

<conditions>

<add input=”{HTTP_HOST}” pattern=”^mydomain.com$” />

</conditions>

<action type=”Redirect” url=”http://www.mydomain.com/{R:0}” redirectType=”Permanent” />

</rule>

 

<rule name=”redirect to new java page” stopProcessing=”true”>

<match url=”^javadeveloper.html” />

<action type=”Redirect” url=”java-development-services.html” redirectType=”Found” />

</rule>

Entry filed under: .net, query on .net, Stuffs.

Which datatype is good for my database field? Sharepoint Core Classes

Leave a comment

Trackback this post  |  Subscribe to the comments via RSS Feed


Archives

Categories

July 2011
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

Blog Stats

  • 8,361