0

this is my UrlRewritingnet config file:

<urlrewritingnet xmlns="http://www.urlrewriting.net/schemas/config/2006/07">
<rewrites>      
    <add name="paginazioneLibri" virtualUrl="^~/home/library/(.[0-9]*){1,3}" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/home/library?page=$1" ignoreCase="true" redirectMode="Permanent" />
    <add name="categorieLibri" virtualUrl="^~/home/library/category/(.[0-9]*)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/home/library?cat=$2" ignoreCase="true" redirectMode="Permanent" />              
</rewrites>

As you can see I have two different rules which impact on the same URL. Basically the second condition doesn't work at all. Is it possible to associate different rules to the same url?

Ras
  • 628
  • 1
  • 11
  • 29
  • The whole point of the "URL Rewrite" mechanism is to improve your SEO ranking and values. And for the same SEO reasons you should never have multiple URLs for the same page. Because this will be marked as "duplicate content" and your website will be penalized. – SmartDev Oct 21 '14 at 13:16
  • The link of content pagination are not indexed so I might have no problem about the SEO. But I would know why the urlrewrite doesn't work. – Ras Oct 21 '14 at 13:18

1 Answers1

1

Try switching them around like this:

<rewrites>      
    <add name="categorieLibri" virtualUrl="^~/home/library/category/(.[0-9]*)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/home/library?cat=$2" ignoreCase="true" redirectMode="Permanent" />
    <add name="paginazioneLibri" virtualUrl="^~/home/library/(.[0-9]*){1,3}" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/home/library?page=$1" ignoreCase="true" redirectMode="Permanent" />              
</rewrites>

Now both should work.

SmartDev
  • 2,802
  • 1
  • 17
  • 22