Forum Moderators: open

Message Too Old, No Replies

http redirect to https

How to make it automatic?

         

MrFishGuy

3:58 am on Nov 28, 2006 (gmt 0)

10+ Year Member



I want people when logging into a particular page to log on in an SSL environment. Is there a way to redirect a page that's http to automatically go to https?

This way if they have the page bookmarked as http, it'll redirect?

The site is hosted so I don't have access to the server and there are other pages in the same directory that don't have to be https.

Thanks for any advice.

mattglet

12:22 pm on Nov 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you using classic ASP or .NET?

MrFishGuy

2:21 am on Nov 29, 2006 (gmt 0)

10+ Year Member



Classic ASP. I found a script that worked for me.

I used the following script:

<%

if Request.ServerVariables("HTTPS") = "off" Then

Response.Redirect("https://" & Request.ServerVariables("HTTP_HOST") &
Request.ServerVariables("URL"))

End if
%>

It worked for me. Thanks.