ISAPI Force to SSL on single domain

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 16
Joined: 10 Jan 2013, 12:24

ISAPI Force to SSL on single domain

12 Jul 2016, 08:16

Hi, have multiple domains on server - but only want to force 1 domain from http to https:

##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 [R,L]

The above works for all domains - how do I determine just one?

User avatar
Posts: 16
Joined: 10 Jan 2013, 12:24

Re: ISAPI Force to SSL on single domain

13 Jul 2016, 05:52

Actually, think I've found the solution...

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

##Redirect non-HTTPS to HTTPS
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} (.*)
RewriteRule .? https://www.domain.com%1 [R,L]

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 19 guests