Strange Happening In Rewrite World

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
seodevhead
Forum Regular
Posts: 705
Joined: Sat Oct 08, 2005 8:18 pm
Location: Windermere, FL

Strange Happening In Rewrite World

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I would bet it's a mismatch between some httpd.conf directives, likely ones governing overrides.
User avatar
seodevhead
Forum Regular
Posts: 705
Joined: Sat Oct 08, 2005 8:18 pm
Location: Windermere, FL

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Windows isn't sensitive to case, whereas every other operating system is. :?:
User avatar
seodevhead
Forum Regular
Posts: 705
Joined: Sat Oct 08, 2005 8:18 pm
Location: Windermere, FL

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Try adding the "nocase" flag to the rule.

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