Headache with a very basic Rewrite Rule !
3 posts
• Page 1 of 1
Headache with a very basic Rewrite Rule !
Hi,
I'm developing a website on a server hosted by our company, with Helicon ISAPI REWRITE version 2.7 (they have this version, and not version 3).
I'm just trying to set up a really basic Rewrite Rule, without any success.
The logic I expect
shopping/ANYTHING-productid.htm => shop/product.asp?ID=productid
How it should rewrite Urls
shopping/nike-running-shoes-12.htm => shop/product.asp?id=12
What I Wrote in httpd.ini (and nothing more)
RewriteRule shop/[^?/]*-(\d+)\.htm shop/product.asp?ID=$1 [QSA]
Infortunately, it always leads to a 404 error :-/ … What can be wrong with my code ?
Do I need to change the Rexep ? DO I need to use [QSA,L] .. ? I'm stuck on this, and tried several combinations , without any success.
(i have also tried several combinations by adding RewriteEngine on or RewriteBase / )
I you have a clue, It would really save my week !!
Thank you very much,
Alex
I'm developing a website on a server hosted by our company, with Helicon ISAPI REWRITE version 2.7 (they have this version, and not version 3).
I'm just trying to set up a really basic Rewrite Rule, without any success.
The logic I expect
shopping/ANYTHING-productid.htm => shop/product.asp?ID=productid
How it should rewrite Urls
shopping/nike-running-shoes-12.htm => shop/product.asp?id=12
What I Wrote in httpd.ini (and nothing more)
RewriteRule shop/[^?/]*-(\d+)\.htm shop/product.asp?ID=$1 [QSA]
Infortunately, it always leads to a 404 error :-/ … What can be wrong with my code ?
Do I need to change the Rexep ? DO I need to use [QSA,L] .. ? I'm stuck on this, and tried several combinations , without any success.
(i have also tried several combinations by adding RewriteEngine on or RewriteBase / )
I you have a clue, It would really save my week !!
Thank you very much,
Alex
Re: Headache with a very basic Rewrite Rule !
Please try
RewriteRule /shop/[^?/]*-(\d+)\.htm /shop/product.asp?ID=$1 [I,L]
RewriteRule /shop/[^?/]*-(\d+)\.htm /shop/product.asp?ID=$1 [I,L]
Re: Headache with a very basic Rewrite Rule !
Hi Sergey,
It seems to be working for me now. I've used the following line on Isapi Rewrite 2.7 :
RewriteRule /shop/([0-9]*)-[^?/]*\.asp /shop/index.asp\?id=$1 [I,L]
I thank you very much for your help !
It seems to be working for me now. I've used the following line on Isapi Rewrite 2.7 :
RewriteRule /shop/([0-9]*)-[^?/]*\.asp /shop/index.asp\?id=$1 [I,L]
I thank you very much for your help !
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest