Quantcast
Channel: URL Rewrite Module
Viewing all articles
Browse latest Browse all 2482

Exclude the first part of a domain name from redirection

$
0
0

I have a site called intranet.domainname.com, and I wanted to make sure users always browsed to it using HTTPS.  So I created a rule that redirects http traffic to https.  It looks for a URL matching (.*), looks to see if {HTTPS} is ^OFF$, and redirects to https://{HTTP_HOST}/{R:1}.  This has worked just fine.  

Later I added a site that is just a short name, it is called internalprod (not internalprod.domainname.com).  I did not want traffic for this site to be redirected to HTTPS since it is internal only, and since my *.domainname.com wildcard certificate would not support it anyway.  I added a condition to the existing rule that looks to see if {HTTP_HOST} Does not match the Pattern internalprod.  Adding this condition works just fine as well.

Now I need to allow users to browse to intranet.domainname.com internally by just typing inhttp://intranet.  The problem is, the redirection rule tries to send them tohttps://intranet, which doesnt work since the wildcard certificate wont support it.  I tried adding a condition to see if {HTTP_HOST} Does Not Match the Pattern intranet, but when I do that, intranet.domainname.com traffic no longer redirects to HTTPS.

How do I add a condition to exclude "intranet" from the redirection, but at the same time NOT exclude "intranet.domainname.com"?


Viewing all articles
Browse latest Browse all 2482

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>