Page 1 of 1

Strange Happening In Rewrite World

Posted: Wed Feb 28, 2007 5:15 pm
by seodevhead
Hey guys,

I recently installed apache, php and mysql on my windows machine here at home. Now that I have copied my work over to my htdocs folder and am testing it in my development server, all is working fine except for a few rewriterules in some .htaccess files.

The odd thing is, that some of them work, and some don't. And even more odd, is they all work on my LAMP production server.. the files/code are the same!

I have really tried my best to determine what is causing some rewrites not to work. Not even getting an internal server error or anything.. just 404's (real 404's.. not ones my scripts produce).

Anyone want to try a shot in the dark for me as to why some rewriterules are working while others are not (within the same .htaccess file)? I'm open to any ideas. Thanks a bunch.

Posted: Wed Feb 28, 2007 10:03 pm
by feyd
I would bet it's a mismatch between some httpd.conf directives, likely ones governing overrides.

Posted: Thu Mar 01, 2007 7:03 am
by seodevhead
The rewriterules that are NOT working are the ones that contain any uppercase letters like:

RewriteRule ^Search/([^/\.]+)/?$ page.php?search=$1 [L]

When I type in the browser:
http://localhost/my-folder/Search/searchterm/

It is being send in all lowercase to apache apparently as:
http://localhost/my-folder/search/searchterm/

Because when I edit my rewrite to reflect a lowercase 's' in 'search/', it works!

Any idea why it is being sent in all lowercase to apache? Where could it be happening? I'm clueless as to where to hunt this down.

Posted: Thu Mar 01, 2007 8:02 am
by feyd
Windows isn't sensitive to case, whereas every other operating system is. :?:

Posted: Thu Mar 01, 2007 8:20 am
by seodevhead
feyd wrote:Windows isn't sensitive to case, whereas every other operating system is. :?:
You think that's it? Hmm... any idea how I can 'work around' that? Or should I just come to the conclusion that doing any rewrites with case sensitivity won't work on my WAMP development server? Thanks feyd.

Posted: Thu Mar 01, 2007 8:40 am
by feyd
Try adding the "nocase" flag to the rule.

http://httpd.apache.org/docs/2.0/mod/mo ... writeflags