We have a website that is run on PHP that we want to automatically redirect to HTTPS when a visitor goes to any page. We have the SSL cert installed correctly, and I have a test directory set up so I can get it working without messing up the whole site, and then things got complicated.
First I tried doing it the way we would have on our old hosting site that used apache, and tried to make it work with .htaccess, and found out that .htaccess doesn't work on IIS.
Then I found an ASP script that is supposed to redirect as a customer error page on a 403.4 error:
<%
Data = request.servervariables("Q
UERY_STRIN
G")
URL = replace(Data, "403;", "")
URL = replace(URL, "
http://", "
https://")
response.Status = "200 OK"
response.redirect URL
%>
but for some reason, when I try to go the the secure page (admin/admin.html) via http, it tries to download the page. It doesn't seem to matter if it's a .php page or a .html page.
Start Free Trial