Search code examples
url-rewritingtuckey-urlrewrite-filter

How to make urlrewrite (tuckey) ignore css and js requests and stop processing other rules?


I have a urlrewrite.xml file with several rules in it. I'd like to put a rule at the very beginning to match any/all css or js requests and just pass them through AND STOP COMPARING TO ANY OTHER RULES...

I've got this:

<rule>
   <name>RULE: ignore js and css</name>
    <from>^(.*(\.css|\.js))$</from>
    <to last="true">$1</to>
</rule> 

but it seems this just causes the whole thing to loop repeatedly.

How can I make this work?


Solution

  • I found an answer...posting it here for future searchers...

    I just had to change the "to" part. Instead of using $1 I found a reference to using the dash '-' so I gave it a try and it worked...

    <rule>
       <name>RULE: ignore js and css</name>
        <from>^(.*(\.css|\.js))$</from>
        <to last="true">-</to>
    </rule>