Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS URL Rewrite - ignore if URL contains

I have the following URL rewrite setup inside web.config working as I would like.

<rule name="Product Rewrite" stopProcessing="true">
  <match url="^products/([^$]+)/([^$]+)" />
  <action type="Rewrite" url="products?durl={R:1}&amp;purl={R:2}" />
</rule>

Now I need to exclude any URLs that contain or end with /action/edit i.e. products/action/edit

I understand that I will need a conditions block, but I am not sure what to write.

Any help would be greatly appreciated.

like image 945
Sean Dooley Avatar asked Jul 01 '15 15:07

Sean Dooley


1 Answers

Add a condition like below, negate true ensures it matches everything except action/edit

<conditions>
 <add input="{URL}" negate="true" pattern="action/edit" />
</conditions>
like image 174
Jeroen Avatar answered Oct 11 '22 02:10

Jeroen