Click here to Skip to main content
15,113,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have designed a website Sapphire Enterprises
I want 301 redirect to[^] to[^]
as it is creating duplicate content issue. For that I add following code in web config file



<rule name="Canonical Host Name" stopprocessing="true">
<rule name="Strip Default.aspx Out">
<match url="(.*)default.aspx" ignorecase="false">
<action type="Redirect" url="{R:1}" redirecttype="Permanent">

but there is blue underline below rewrite and the code is not working.

I got the idea from this post

But is not working. Please help me. I am using visual studio 2008 and installed IIS URL rewrite Module 2 also.
Updated 1-Apr-15 22:03pm

1 solution

In the folder of your old page, add a Web.Config file and put this in the configuration tag:
<location path="old.aspx">
    <httpRedirect enabled="true" destination="new.aspx" httpResponseStatus="Permanent" />

Important: destination has to be a path relative to old.aspx. If you want to make it relative to the root of the web server, make sure it starts with a slash.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900