Http to Https
4 posts
• Page 1 of 1
Http to Https
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
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
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Http to Https
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
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
Re: Http to Https
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]
# 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]
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Http to Https
If not, I'd try:
Regards
- 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
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 15 guests