Rewrite with .asp and parameter?

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 2
Joined: 27 Mar 2014, 14:30

Rewrite with .asp and parameter?

27 Mar 2014, 14:35

Hi gang,
I am new to the rewrite tech...I am trying to get a rule going where any ".asp" file with a certain URL param points to a new route...for example, I want:

www.temp.com/catalog/mens.asp?c=1 to go to www.temp.com/Catalog/Category/1
and
www.temp.com/catalog/womens.asp?c=200 to go to www.temp.com/Catalog/Category/200

So far, I have...
#RewriteRule ^catalog/(.*\.asp)([^/]*)(/.+)? /Catalog/Category/$1 [I,R]
I think I am handling the wildcard search for "mens" and "womens" correctly, but I am having trouble getting the value of "c" off the url.

I appreciate the help!
Thanks!
DJO

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Rewrite with .asp and parameter?

28 Mar 2014, 05:13

Hello,

If you are using ISAPI_Rewrite 3, then the syntax should be as follows:

RewriteBase /
RewriteCond %{QUERY_STRING} ^c=(\d+)$ [NC]
RewriteRule ^catalog/.*\.asp$ /Catalog/Category/%1? [NC,R]

User avatar
Posts: 2
Joined: 27 Mar 2014, 14:30

Re: Rewrite with .asp and parameter?

28 Mar 2014, 17:53

Anton,
That worked perfectly. Thank you for the help!!

Thanks,
Denis

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 0 guests