IIS Url canonical rewrite, but preserve IP Address

2019-08-20 03:49发布

问题:

I'm a little stumped. We have a load balancer in front of our web servers, and rules in place to do a canonical rewrite from myDomain.com to www.mydomain.com.

This works great, but prior to adding this rule, I could hit my individual servers by IP address (bypassing the load balancer), and therefore check statuses, etc.

I've tried adding a rule first to allow the IP address, but it still seems to process the others regardless of my settings.

This is IIS 7.0. any help would be greatly appreciated on how to write the rules correctly.

回答1:

Ok, finally figured it out. I added another canonical rule above my domain name canonical rule that matches the pattern of my IP address, and then just told it to do nothing, and stop processing rules.

It works.