Advertisement

05.06.2008 at 01:10PM PDT, ID: 23380777
[x]
Attachment Details

Redirecting HTTP to HTTPS with PHP pages

Asked by andyd273 in Secure Socket Layer (SSL) & HTTPS, PHP Scripting Language, Microsoft IIS Web Server

Tags: Microsoft, IIS, 6, PHP,

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("QUERY_STRING")
 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
[+][-]05.06.2008 at 01:15PM PDT, ID: 21510650

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.06.2008 at 01:29PM PDT, ID: 21510765

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.06.2008 at 02:10PM PDT, ID: 21511117

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.06.2008 at 07:11PM PDT, ID: 21512695

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Secure Socket Layer (SSL) & HTTPS, PHP Scripting Language, Microsoft IIS Web Server
Tags: Microsoft, IIS, 6, PHP,
Sign Up Now!
Solution Provided By: jtarabay
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.07.2008 at 05:10AM PDT, ID: 21515449

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.07.2008 at 07:15AM PDT, ID: 21516581

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.07.2008 at 07:22AM PDT, ID: 21516663

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.07.2008 at 07:27AM PDT, ID: 21516731

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.07.2008 at 07:41AM PDT, ID: 21516914

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.07.2008 at 08:39AM PDT, ID: 21517564

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.07.2008 at 10:29AM PDT, ID: 21518554

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.07.2008 at 10:50AM PDT, ID: 21518744

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.08.2008 at 11:10AM PDT, ID: 21527033

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.08.2008 at 07:47PM PDT, ID: 21530136

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628