apache on windows virtual directory config help apache on windows virtual directory config help windows windows

apache on windows virtual directory config help


Figured it out: use Alias for #3, instead of VirtualHost, thus:

Alias /myproject "C:/path/to/my/project"<Directory "C:/path/to/my/project">  Options Indexes FollowSymLinks MultiViews ExecCGI  AllowOverride All  Order allow,deny  Allow from all</Directory>


To accomplish your list of needs.

1) Make the directory:

mkdir c:\xampp\sites\myproject

2) Edit c:\windows\system32\drivers\etc\hosts so it contains this line:

127.0.0.1         myproject

and add the following to c:\xampp\apache\conf\extra\httpd-vhosts.conf:

  NameVirtualHost myproject:80  <VirtualHost myproject:80>  DocumentRoot c:/xampp/sites/myproject  Options Indexes FollowSymLinks Includes ExecCGI   AllowOverride All  Order allow,deny  Allow from all    </Directory>

3) Add the following lines to the end of c:\xampp\apache\conf\httpd.conf:

  Alias /myproject/  "/xampp/sites/myproject/"  <Directory "/xampp/sites/myproject">  AllowOverride None  Options None  Order allow,deny  Allow from all  </Directory>

4) Leave DocumentRoot, Directory, etc in c:\xampp\apache\conf\httpd.conf alone to accomplish this. For reference these lines would be:

  DocumentRoot "/xampp/htdocs"  <Directory />   Options FollowSymLinks   AllowOverride None   Order deny,allow   Deny from all  </Directory>  <Directory "/xampp/htdocs">   Options Indexes FollowSymLinks Includes ExecCGI   AllowOverride All   Order allow,deny   Allow from all  </Directory>


First enable: LoadModule alias_module modules/mod_alias.so

<IfModule alias_module>  Alias /ddd "D:/prj/customer/www"  <Directory "D:/prj/customer/www">    Options Indexes FollowSymLinks Includes ExecCGI    AllowOverride all    Order allow,deny    Allow from all  </Directory></IfModule>

Tested on WAMP 2.2 and its working: http:// localhost/ddd