Http to Https

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 2
Joined: 29 Apr 2014, 17:47

Http to Https

29 Apr 2014, 17:57

I'm having trouble doing an http to https redirect for my site. I'm trying to force the whole site to https and I've tried using the code examples but I think they may be to general and are not taking into account URL parameters.

Here are some example URLs

http://www.codale.com/
http://www.codale.com/index.jsp?ID=,Adhesives..Sealants.and.Tape&path=to&ds=dept
http://www.codale.com/index.jsp?ID=,Adhesives..Sealants.and.Tape,Tapes,Electrical.Tape&path=find&ds=dept&a=1

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

Re: Http to Https

30 Apr 2014, 09:41

Hello,

In case you want to include querystring in redirects, simply add [QSA]-flag. We suggest taking the code from examples section and adding this flag.


Regards

User avatar
Posts: 2
Joined: 29 Apr 2014, 17:47

Re: Http to Https

02 May 2014, 11:36

Just to be absolutely clear, would this work?

# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.104

RewriteEngine on

#Fix missing trailing slash char on folders
RewriteRule ^([^.?]+[^.?/])$ $1/ [R,L]

#Redirect non-HTTPS to HTTPS
RewriteCond %{HTTP:Host} (.*)
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} (.*)
RewriteRule .? https://%1%2 [QSA,R,L]

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

Re: Http to Https

02 May 2014, 19:36

If not, I'd try:

Code: Select all
#Redirect non-HTTPS to HTTPS
RewriteCond %{HTTP:Host} (.*)
RewriteCond %{HTTPS} !on
RewriteCond %{REQUEST_URI} (.*)
RewriteRule .* https://%1%2 [NC,QSA,R=301,L]


Regards

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 15 guests