Click to See Complete Forum and Search --> : mod_rewrite woes


Mindzai
02-09-2009, 11:08 AM
I have a URl I'm trying to rewrite. The URL looks like this:

http://www.domain.com/photo-gallery/country/keyword/46

I want to simply take everything after photo-gallery/ and pass it to a php script. However rewrite does not seem to like the hyphen.

Here's some things i've tried:


<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^photo-gallery/(.*)$ photo-gallery.php?req=$1 [L]
RewriteRule ^photo\-gallery/(.*)$ photo-gallery.php?req=$1 [L]
RewriteRule ^photo.gallery/(.*)$ photo-gallery.php?req=$1 [L]
</IfModule>


None of which work. However as soon as I change the url to photo_gallery (ie replace the hyphen with an underscore) and adjust the rules accordingly it works fine.

Any ideas?

Mindzai
02-11-2009, 08:41 AM
I've done some testing and this issue is only apparent when running apache under OSX. On linux and windows boxes the exact same file produces the desired effect. Does anyone have any idea why this may not be working on my mac?