Forum Moderators: phranque

Message Too Old, No Replies

Automatically serving /foo.php if request is just /foo

What config statement causes this?

         

dmorison

10:59 pm on Jan 31, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hiya,

I'm trying to diagnose a .htaccess/mod_rewrite problem on a client's machine. It is running Apache 1.3.33. I pretty quickly figured out what was causing my rewrite rules to never get executed...

On this box, a request for /foo will serve /foo.php if the file foo.php exists, and then, it seems, the ReWrite rules from .htaccess are not considered.

Does anybody know what configuration directive is causing this behaviour? Could it be a global ReWrite in their main Apache configuration. If so - is there any way to override this in a directory level rewrite?

I'm trying to rewrite /foo/bar.html to foo.php?q=bar using the following rule:

^foo/(.*).html$ foo.php?q=$1 [L]

Any ideas?

jdMorgan

11:35 pm on Jan 31, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try adding

[url=http://httpd.apache.org/docs/1.3/mod/core.html#options]Options[/url] -MultiViews

to .htaccess to disable content-negotiation. You'll find the server runs a bit faster, too.

You can combine that with other options, too, such as

Options +FollowSymLinks -Indexes -MultiViews

Jim

dmorison

12:03 am on Feb 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Bingo - thanks, Jim.