Rewrite with .asp and parameter?
3 posts
• Page 1 of 1
Rewrite with .asp and parameter?
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
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
Re: Rewrite with .asp and parameter?
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]
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]
Re: Rewrite with .asp and parameter?
Anton,
That worked perfectly. Thank you for the help!!
Thanks,
Denis
That worked perfectly. Thank you for the help!!
Thanks,
Denis
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests