Forum Moderators: phranque

Message Too Old, No Replies

Can't seem to stop a rewrite despite fishing around

         

formasfunction

1:15 am on Apr 3, 2008 (gmt 0)

10+ Year Member



For some reason I can't seem to kill a rewrite in the local apache installation of Mac 10.5. Here's what I've done so far:
1. I've created a new virtual host in httpd-vhosts.conf named test.dev
2. This is pointing to a folder at /Users/myusername/Sites/test
3. There is no .htaccess file in /test or /Sites
4. I've tried disabling MultiViews in the main httpd.conf
5. I've restarted Apache after each change

The current behavior I'm try to stop is as follows:
If I put foo.php in the root of test.dev, visiting test.dev/foo and test.dev/foo/ both access foo.php. As well, if I change foo.php to foo.html it can be accessed via test.dev/foo but not test.dev/foo/. I want to make it so there is no rewriting happening and these files can only be accessed by calling them directly (e.g. test.dev/foo.php or test.dev/foo.html).

Is there something in the default install that may be causing this? What's the best way to track it down?

jdMorgan

1:21 am on Apr 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What Apache version, please?

Jim

formasfunction

1:27 am on Apr 3, 2008 (gmt 0)

10+ Year Member



Server version: Apache/2.2.8 (Unix)

jdMorgan

1:38 am on Apr 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Disable MultiViews and AcceptPathInfo:

Options -MultiViews
AcceptPathInfo Off

Restart Apache and completely flush your browser cache before testing.

mod_dir will append a trailing slash to /foo if /foo/ exists as a directory.

If foo.php is defined as DirectoryIndex, then you may be getting an interaction with AcceptPathInfo, but I can't really be sure.

Jim

formasfunction

4:22 am on Apr 3, 2008 (gmt 0)

10+ Year Member



I put those two directives in a .htaccess file and it's fixed. Thanks a bunch!