Can't seem to stop a rewrite in Leopard's apache

Discussion in 'Web Design and Development' started by formasfunction, Apr 2, 2008.

  1. formasfunction macrumors newbie

    Aug 27, 2002
    For some reason I can't seem to kill a rewrite in the local apache installation of Leopard. Here's what I've done so far:
    I've created a new virtual host in httpd-vhosts.conf named
    This is pointing to a folder at /Users/myusername/Sites/test
    There is no .htaccess file in /test or /Sites
    I've tried disabling MultiViews in the main httpd.conf
    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, visiting and both access foo.php. As well, if I change foo.php to foo.html it can be accessed via but not I want to make it so there is no rewriting happening and these files can only be accessed by calling them directly (e.g. or

    Is there something in the default install that's causing this? How can I kill it?
  2. angelwatt Moderator emeritus


    Aug 16, 2005
    There's a line in httpd.conf that defines what file name will be looked for by default for a directory. If you have and go there it'll load a file even though one wasn't declared in the URL. The line in Apache tells it which files to look for and are generally in the form of;

    DirectoryIndex   index.html index.htm index.shtml default.htm default.html index.php
    Also look for lines that start with RewriteRule or RewriteCond.

Share This Page