Click here to Skip to main content
15,917,481 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have several URLs which I need to transfer to domain name. I have tried through code but I am getting two 301 redirects.

My requirement is to simply redirect below URLs to domain.
http://domain.com/index.php
http://domain.com/index.htm
http://domain.com/index.html
http://domain.com/index.shtml
http://domain.com/index.asp
http://domain.com/default.asp
http://domain.com/default.aspx
http://domain.com/index.aspx
http://domain.com/index.cfm
http://domain.com/index.pl
http://domain.com/default.htm


when i tried the above URLS they give me 2 301 redirects I only need 1 301 redirec

Can I do through IIS 7.

What I have tried:

<rule name="default page" stopprocessing="true"> 
<match url="(.*)default.aspx$" />
<action type="Redirect" url="{R:1}" redirecttype="Permanent" />
</rule>


http://domain.com/index.php
301 to
http://www.domain.com/index.php
and then again 301 to
http://www.domain.com
200 ok
Posted
Updated 3-Apr-16 20:53pm
v2

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