HTTP to HTTPS

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 9
Joined: 12 Feb 2013, 10:01

HTTP to HTTPS

27 Sep 2013, 08:15

Hello, I have searched for this, implemented the suggestions but to no avail. I actually have a feeling, however, that the implementations are not wrong and there is an issue with the domain name of my site. It is unusual (perhaps) because it utilises 2 subdomains... so this is what I have tried

HTTP to HTTPS

Code: Select all
RewriteCond %{HTTP:Host} subd1\.subd2\.host\.co\.uk
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} (.*)
RewriteRule (.*) https\://subd1\.subd2\.host\.co\.uk$1 [R,L]


/*******************************/

Code: Select all
RewriteCond %{HTTP:Host} subd1\.subd2\.host\.co\.uk
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} (.*)
RewriteRule .? https://%1%2 [R,L]


/*******************************/

RewriteCond %{HTTP:Host} subd1\.subd2\.host\.co\.uk
RewriteRule (.*) https\://subd1\.subd2\.host\.co\.uk$1 [NC,L,NS]



/*******************************/

The above have not worked so I thought I'd check something that I know works - a simple redirect from one location to another

Redirect

Code: Select all
RewriteCond %{HTTP:Host} subd1\.subd2\.host\.co\.uk
RewriteRule ^/location1(|/) http\://subd1\.subd2\.host\.co\.uk/location2 [NC,R,L]


This also does not work.

This has lead me to think that the rewrite tool is having trouble matching the 2 subdomains. Any help greatly appreciated.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: HTTP to HTTPS

27 Sep 2013, 09:23

I don't see why ISAPI_Rewrite would have trouble matching 2 subdomains.
Lets try to continue tweaking you rule and start with the simplest:

Code: Select all
RewriteEngine on
RewriteBase /

RewriteCond %{HTTP:Host} ^subd1\.subd2\.host\.co\.uk$ [NC,L]
RewriteRule ^(?:location1|/) http://subd1.subd2.host.co.uk/location2 [NC,R=301,L]


We also can at any time take a look at the logs and see how the request is processes. This will allow us to track the source of the problem.
Logging issues are described in FAQ - http://www.helicontech.com/forum/10648-FAQ.html

Regards
Andrew

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 4 guests