- Windows 7 Ultimate (64-bit)
- Apache HTTP Server 2.2.15 (32-bit)
- PHP 5.3.2 (32-bit)
httpd.conf is default except I uncommented the line for mod_rewrite and the one that loads httpd-vhosts.conf, which looks like this:
# # Virtual Hosts # # If you want to maintain multiple domains/hostnames on your # machine you can setup VirtualHost containers for them. Most configurations # use only name-based virtual hosts so the server doesn't need to worry about # IP addresses. This is indicated by the asterisks in the directives below. # # Please see the documentation at # <URL:http://httpd.apache.org/docs/2.2/vhosts/> # for further details before you try to setup virtual hosts. # # You may use the command line option '-S' to verify your virtual host # configuration. <Directory "D:/Path/To/Sites"> Options Indexes Order Deny,Allow Allow from all </Directory> # # Use name-based virtual hosting. # NameVirtualHost *:80 # # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for all requests that do not # match a ServerName or ServerAlias in any <VirtualHost> block. # <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "D:/Path/To/Site 1" ServerName site1.local ServerAlias www.site1.local ErrorLog "logs/site1.local-error.log" LogLevel debug CustomLog "logs/site1.local-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "D:/Path/To/Sites/Site 2" ServerName site2.local ServerAlias www.site2.local ErrorLog "logs/site2.local-error.log" LogLevel debug CustomLog "logs/site2.local-access.log" common </VirtualHost> <VirtualHost *:80> DocumentRoot "D:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs" ServerName localhost </VirtualHost>
Windows hosts file forwards site1.local and site2.local to 127.0.0.1.
When trying to access site2.local, .htaccess is clearly being ignored. In site2.local-error.log, the ONLY error each time I try to access it is this:
[Wed Jul 21 17:57:06 2010] [error] [client 127.0.0.1] client denied by server configuration: D:/Path/To/Sites/Site 2/.htaccess
But, even when I delete everything in .htaccess, I still get the same error. Moving Directory inside VirtualHost makes no difference; nor does moving the contents of Site 2 to htdocs.