0
votes

Just got our SSL certificate installed and we want to redirect traffic to https. Running IIS 7 on Windows Server 2008 using URL Rewrite module, we want to redirect traffic to the secure protocol, but not from a particular subdomain.

For example:

mydomain.com and www.mydomain.com, we want to redirect to HTTPS

However, admin.mydomain.com, we want to leave on the HTTP protocol

This is the example I followed . I set up an inbound rule and the matching the URL pattern I'm using is:

^(?!(admin).*).*$ 

This redirects traffic from the domain, but it's also redirecting traffic from admin.mydomain.com, which we don't want. What pattern would I use to redirect all traffic, except for a particular subdomain?

1

1 Answers

1
votes

You'll need to remove what you have and keep the rule from the example, then add one more condition like below. Negate=true ensures the rules matches everything except the domain you want to exclude:

<add input="{HTTP_HOST}" negate="true" pattern="^admin.mydomain.com$"/>