IIS Url Rewrite: how to ignore miniature javascript and css

Using the following rule, I can successfully rewrite URLs to redirect to app / index.cshtml. Som resources such as images, css and javascripts should not be redirected, so I used the conditions:

<rule name="AngularJS"> <match url="(.*)" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> <add input="{URL}" negate="true" pattern="\.png$" /> <add input="{URL}" negate="true" pattern="\.css$" />> <add input="{URL}" negate="true" pattern="\.js$" /> </conditions> <action type="Rewrite" url="app/index.cshtml" /> </rule> 

But as soon as I start using the mini content, the requested URL will look like:

/ myapp / bundles / utilities? v = EH9YuZDBt_fj7iqRP2QA8lCkJ59wjV6woELIwvR7irk1

How to prevent this type of url from being redirected?

+4
source share
1 answer

You can create an ignore rule, match URLs to ignore

 <rule name="Ignore" enabled="true" stopProcessing="true"> <match url="^(images|css|bundles).*"/> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"/> <action type="None"/> </rule> 
+5
source

Source: https://habr.com/ru/post/1487279/


All Articles