We help IT Professionals succeed at work.

Excluding Ip address in rewrite

I have my rewrite from IIS 7.
One of these rules is causing when I type in my ip address, it's forwarding to the main url instead.
How can I exclude the ip address ***.***.***.*** from redirecting to kars4kids.or
                <rule name="LowerCaseRule1" enabled="false" stopProcessing="true">
                    <match url="[A-Z]" ignoreCase="false" />
                    <action type="Redirect" url="{ToLower:{URL}}" />
                <rule name="CanonicalHostNameRule1" enabled="false">
                    <match url="(.*)" />
                        <add input="{HTTP_HOST}" pattern="^www\.kars4kids\.org$" negate="true" />
                    <action type="Redirect" url="http://www.kars4kids.org/{R:1}" />
                <rule name="INDEX FILES" enabled="false" patternSyntax="Wildcard" stopProcessing="true">
                    <match url="index.*" />
                    <action type="Redirect" url="/" appendQueryString="true" />

Open in new window

Watch Question

Top Expert 2004
Try something like this:

<conditions logicalGrouping="MatchAll">
  <add input="{HTTP_HOST}" pattern="^www\.kars4kids\.org$" negate="true" />
  <add input="{HTTP_HOST}" pattern="^1\.2\.3\.4$" negate="true" />

Open in new window

I'm a little curious if this would work:

  <add input="{HTTP_HOST}" pattern="^(www\.kars4kids\.org|1\.2\.3\.4)$" negate="true" />

Open in new window

Explore More ContentExplore courses, solutions, and other research materials related to this topic.