views:

14

answers:

1

I have 2 similar rewrite rules, that is killing each other.

These are my rules:

<rule name="Product rewrite">
<match url="^product/([_0-9a-z-]+)/([0-9]+)" />
<action type="Rewrite" url="product.asp?id={R:2}" />
</rule>

<rule name="Article rewrite">
<match url="^([_0-9a-z-]+)/([0-9]+)" />
<action type="Rewrite" url="article.asp?id={R:2}" />
</rule>

Now the problem is that when I call page like this:

/product/56-little-stars/14

then page article.asp is called, instead product.asp, but when I set URL like this:

/product/56-little-stars/14

then everything is all right. So can you tell me how to make that all 2 rewrite rules works together. I want be able to call article like this:

/this-is-title-of-my-article/11 <-> article.asp?id=11

And to call product like this

/product/56-little-stars/14 <-> product.asp?id=14

Thank you !

A: 

If I understand correctly you just need to add the stopProcessing="true" so that once the product rule applies (which is the more specific) then it will not apply the second one.

<rule name="Product rewrite" stopProcessing="true">  
CarlosAg
I did that, but now when I call "/product/56-little-stars/14" it's taking too much long, like it's redirecting or something before land on page it should. Can anyone knows what's the problem.
Tjodalv