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

    Joined:
    Aug 27, 2002
    #1
    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 test.dev
    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 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's causing this? How can I kill it?
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    There's a line in httpd.conf that defines what file name will be looked for by default for a directory. If you have somesite.com 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;

    Code:
    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