Forum Moderators: open
I have set up a 301 permanent redirect in my IIS which will redirect requests for domain.com to www.domain.com
This is working fine, but whenever there is a request for URLs such as
domain.com/file.aspx
domain.com/contac.aspx
..these are also getting redirected to www.domain.com
How do I fix this...I want requests for domain.com/contact.aspx to redirect to www.domain.com/contact.aspx
Another thing that I want to know is how do I redirect the index file to /
Whenever I try to redirect is through the IIS control panel by right-clicking>properties>redirect it is creating an infinite loop.
Thanks a lot in advance!
Whenever I try to redirect is through the IIS control panel by right-clicking>properties>redirect it is creating an infinite loop.
If Request.ServerVariables("HTTP_HOST") = "mydomain.com" Then
Response.Status = "301 Moved Permanently"
Response.AddHeader("Location", "http://www.mydomain.com" & Request.RawUrl)
End If
I have fixed the first problem, now let me share with you all how I did it:
I created a site in the IIS with domain.com as the host name and then 301 redirected it [by right click > properties] to www.domain.com$S I was missing the $S part for which requests for domain.com/contact.aspx was getting redirected to www.domain.com. The redirect wasn't passing any suffixes. So I fixed that and it's working fine. Thanks again!
Now the BIG problem (for me at least)
How do I redirect www.domain.com/default.aspx to www.domain.com/
I have tried numerous ways of doing this, but it just doesn't work. I would be very grateful if you all can guide me through this.
Thanks a lot in advance :-)
To redirect "/default.aspx" to "/" I think you have to use IsapiRewrite or similar.