I have been trying solutions for 6 hours to get this right but cannot find anything on either stack or microsoft's dev blogs. I am trying to force an HTTPS redirect from all external calls to my website while still going to the HTTP site when the website is accessed via an internal call, in this case by use of the IP address 192.168.8.68 in the URL bar of the browser. This worked perfectly until we installed an SSL certificate yesterday and implemented the following redirect rule:
<rule name="Redirect to HTTPS" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTPS}" pattern="OFF" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" appendQueryString="false" />
</rule>
What I would like to know is, how would i bypass this if the incoming IP Address has the form 192.168.8.*
? Adding specific iPs in regex causes the website to fail to load with a "Too many redirects error". I have already looked at the following list of questions in an attempt to solve this problem:
https://forums.iis.net/t/1166994.aspx?Rewrite+Redirection+for+only+external+users
IIS 7.5 redirect certain requests to other server using ip address
IIS | Block page specific url except for specific internal IP address
https://docs.secureauth.com/display/KBA/Use+URL+Rewrite+for+IP+Restrictions
Two instances of the same Website on IIS with different web.config (two different databases)
Single Website Directory / Multiple IIS Websites (Multiple web.config files)