Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having a weird redirect problem on my local server. I have a VirtualHost set up:

NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot "/Users/iMac/Sites/index.php"
    ServerName jordan.local
    ErrorLog "/private/var/log/apache2/jordan.local-error_log"
    CustomLog "/private/var/log/apache2/jordan.local-access_log" common  
    <Directory "/Users/iMac/Sites/index.php">
        AllowOverride All
        Order allow,deny
        Allow from all

Accessing http://jordan.local works fine. However, when I attempt to access a subdirectory jordan.local/somefolder/index.php, the page shown is jordan.local/index.php. I do not have an .htaccess file and have restarted apache numerous times.

Apache version: 2.2.22 (Unix)
Mac OS X 10.7.5

Here's my host file if it's any help:       localhost broadcasthost
::1             localhost
fe80::1%lo0     localhost
#       jordan.local

All of the local URL's I accessed (that are non-existent) showed up in my custom access logs as a 200 response code.

My Apache error logs are giving this warning:
Warning: DocumentRoot [/Users/iMac/Sites/index.php] does not exist
Although /Users/iMac/Sites/index.php is a valid path.

Please let me know if you need any more information.

share|improve this question

closed as off-topic by Shane Madden, mdpc, Scott Pack, Ward, Jenny D Jul 22 '13 at 9:00

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about hardware or software used in a home setting are off-topic because they require answers that may not be practical for the business and support professionals here. You should try asking on Super User instead." – Shane Madden, mdpc, Scott Pack, Ward, Jenny D
If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 0 down vote accepted

Please change DocumentRoot to point to a directory, not a file. Reference:


DirectiveDescription: Directory that forms the main document tree visible from the web

Syntax: DocumentRoot directory-path

Default: DocumentRoot /usr/local/apache/htdocs

Context: server config, virtual host

Status: Core

Module: core

This directive sets the directory from which httpd will serve files. Unless matched by a directive like Alias, the server appends the path from the requested URL to the document root to make the path to the document.


 DocumentRoot /usr/web 

then an access to refers to /usr/web/index.html. If the directory-path is not absolute then it is assumed to be relative to the ServerRoot.

The DocumentRoot should be specified without a trailing slash.

share|improve this answer
Perfect! Thanks!! – Jordan Jul 22 '13 at 0:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.