Domanda

My real url looks like this:

localhost/shop.asp?product=100&name=Product-name&category=cellphones

My rewritten url looks like:

localhost/cellphones/product-name/product-name_100.aspx

I use Helicon URL Rewriter and what i need to do is this: If my rewritten URL exceeds 200 characters it should redirect to "Default.aspx" Is there a rewrite rule for this?

È stato utile?

Soluzione

If you are using ISAPI_Rewrite 3, your rule should look like this:

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.{100} /Default.aspx [R=301,L]
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top