Welcome to WebmasterWorld Guest from 54.166.133.84

Forum Moderators: ocean10000

Message Too Old, No Replies

How To 301 Redirect https pages to http?

We use IIS 6 without ISAPI Rewrite capability

     
3:03 pm on Aug 14, 2009 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 24, 2005
posts: 178
votes: 0


We have some https ASP pages living in a couple of subfolders. We want to 301 redirect them to the http versions. How do we do that without using ISAPI rewrite?
5:01 pm on Aug 14, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 1, 2005
posts:732
votes: 0


Hi Jastra, you can check to see if the request is secure by checking Request.ServerVariables("HTTPS"), eg.


<%
if Request.ServerVariables("HTTPS") = "on" then
server = Request.ServerVariables("SERVER_NAME")
script = Request.ServerVariables("SCRIPT_NAME")

Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://" & server & script
end if

' Otherwise, continue with normal page operation
%>