https to http without one specific domain

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 16
Joined: 22 Apr 2015, 18:41

https to http without one specific domain

28 Jan 2016, 15:59

Hi,

We are using ISAPI_Rewrite to change Https to Http, and the code:

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

which works fine.

However, we want except one specific domain, like test.domain.com.

Rest of all https://*.domain.com should still be changed to http://*.domain.com

How should we modify the code.

Thank you and regards!

Yeming

User avatar
Posts: 402
Joined: 06 Mar 2012, 11:59

Re: https to http without one specific domain

29 Jan 2016, 10:09

Hello.

Try this rule:

Code: Select all
RewriteCond %{HTTP:Host} (?!test\.)(.*) [NC]
RewriteCond %{HTTPS} on [NC]
RewriteCond %{REQUEST_URI} (.*)
RewriteRule .? http://%1%2 [R=301,L]

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 19 guests