rewrite rule not working

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 2
Joined: 05 Oct 2013, 19:40

rewrite rule not working

05 Oct 2013, 19:45

Hi,

I just installed ISAPI_Rewrite 3.0, and have written following rules

RewriteRule /products /products.asp [I]
RewriteRule /products_details /products_details.asp [I]


When i try to go to products_details.asp page, I am redirected to products.asp page.

Can someone please help me to fix this?

Thanks,
Manish

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: rewrite rule not working

07 Oct 2013, 09:07

Hello,

You need to specify the beginning and the end of the pattern:

^ - is the beginning
$ - is the end.

Right now you have the first rule working for every request that has "/product" (and can be followed by any other characters). So the second rule never works.

Try using:
Code: Select all
RewriteRule ^/products$ /products.asp [I]
RewriteRule ^/products_details$ /products_details.asp [I]


Regards
Andrew

User avatar
Posts: 2
Joined: 05 Oct 2013, 19:40

Re: rewrite rule not working

07 Oct 2013, 11:24

Thank you Andrew very much. I figured out this going through the docs and examples on the helicon site.
Now my rules are working.


Thanks,
Manish

User avatar
Posts: 1
Joined: 13 Nov 2013, 16:38

Re: rewrite rule not working

13 Nov 2013, 16:49

Hi



I have a file in my website is called cleaningrugtoronto.html I would like to refer it as cleans.

My hosting company is based on IIS. They told me IIS doesn't work with .htaccess.

I created a httpd.conf file with following rules

RewriteEngine On
RewriteRule ^/cleans$ /cleaningrugtoronto.html

When I type www.persianrugservices.ca/cleans I get the message the page cannot be found

Any help?

Thanks

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 13 guests