mod_rewrite

Hi,

Here is my rule:

RewriteRule ^[^/]+/([^/]*)/([^/]*)\\.php$ /review_single.php?item_id=$1&id=$2 [L]

Original URL:

http://www.site.com/review_single.php?item_id=65&id=1007

Rewritten URL:

http://www.site.com/Chilis/65/1007.php

The word chilis is a category that gets pulled from the database.


Issue:
That works great but there’s a part of the website that will only work if I put a forward slash at the beginning changing it to this:

RewriteRule ^/[^/]+/([^/]*)/([^/]*)\\.php$ /review_single.php?item_id=$1&id=$2 [L]

BUT when I do that, it breaks another part of the site.

How do I rewrite that so that one area of the site will work with the ‘/’ and the other part will work without it?

Thanks in advance,

Tim

You could make the / at the start optional by using

/?

but it sounds like a weird problem. Why doesn’t a part of the website work without that leading slash?