Headache with a very basic Rewrite Rule !

ISAPI_Rewrite is a powerful URL manipulation engine based on regular expressions
User avatar
Posts: 4
Joined: 25 Aug 2012, 19:55

Headache with a very basic Rewrite Rule !

09 Aug 2013, 23:57

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

User avatar
Posts: 28
Joined: 02 Mar 2012, 12:50

Re: Headache with a very basic Rewrite Rule !

12 Aug 2013, 06:57

Please try

RewriteRule /shop/[^?/]*-(\d+)\.htm /shop/product.asp?ID=$1 [I,L]

User avatar
Posts: 4
Joined: 25 Aug 2012, 19:55

Re: Headache with a very basic Rewrite Rule !

23 Aug 2013, 14:17

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 !

Return to ISAPI_Rewrite 2.x

Who is online

Users browsing this forum: No registered users and 1 guest