Forum Moderators: phranque

Message Too Old, No Replies

Rewrite from /subdir/xyz.html to subdir.php? works on one server

fails on another?

         

whoisgregg

10:51 pm on Feb 20, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have two servers behaving differently. My test server fails as described below while my production server exhibits no errors whatsoever. I'm curious if anyone has come across this and knows what setting to toggle.

Given this directory structure:

../
../widgets/
../widgets/.htaccess
../widgets/faq.php

With the .htaccess shown having these contents:

Options +FollowSymlinks
RewriteEngine On
RewriteBase /widgets
RewriteRule ^faq/([0-9]+)\.html$ /widgets/faq.php?category=widgets&article=$1 [L]
RewriteRule ^faq/$ /widgets/faq.php?category=widgets [L]

And with faq.php containing:

<?php
print_r($_GET);
?>

On my test server, any request for /widget/faq/123.html appears to be passed directly to faq.php without any processing my mod_rewrite. The GET array is empty. If I change the name of faq.php to faq_script.php (and the names of that file in the .htaccess to faq_script.php) then everything works as expected. Using faq.php on my production server also works as expected. :/

Of course, my two servers are very different from each other (yeah, I know...), so it's not as simple as doing a quick comparison of a few varying settings. :(

It appears almost as though there is a "interpret directory names as script names" directive that takes precedence over mod_rewrite... Any ideas where to look next?

jdMorgan

3:16 am on Feb 21, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If your non-working server is Apache 2.x, see the AcceptPathInfo directive in Apache core docs.

Jim

whoisgregg

3:58 pm on Feb 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It is an Apache 2.x server, and that directive precisely describes the behavior I'm seeing. I will be turning it off today. :)