Forum Moderators: phranque
however, if my product name contains a period (.), the rewrite rule doesn't work. Underscores and hyphens are also working fine.
What's wrong with the following rewrite rule?
RewriteRule ^dir/([_a-z0-9-]+)/?$ /dir/product_details.php?product_id=$1
experienced,
See ISAPI Rewrite for IIS -- It is an inexpensive module you can buy and install on MS servers to do many of the things that mod_rewrite on Apache can do. It's easy to find with a search for "ISAPI Rewrite".
Jim
I have finally put two rewrite rules - one for period (.) and another for underscore and hyphen
RewriteRule ^dir/([_a-z0-9-]+)/?$ /dir/product_details.php?product_id=$1
RewriteRule ^dir/([.a-z0-9-]+)/?$ /dir/product_details.php?product_id=$1
Just wanted to know if this will put any negative implication?
or shall i use [L] after teh rewrite rule?
RewriteRule ^dir/([_a-z0-9-]+)/?$ /dir/product_details.php?product_id=$1 [L]
RewriteRule ^dir/([.a-z0-9-]+)/?$ /dir/product_details.php?product_id=$1 [L]
If you are having trouble with hyphen, underscore, and period when combined in a [_.-] group, I suspect there's something wrong with your mod_rewrite or regular-expressions library installation, or that you've got obsolete versions. I can combine them in any way I like without causing errors on my servers. Very strange...
Again, the information in your server error log might be very useful...
Jim