完成您的需求清单。
1)制作目录:
mkdir c:\xampp\sites\myproject
2) 编辑 c:\windows\system32\drivers\etc\hosts 使其包含这一行:
127.0.0.1 我的项目
并将以下内容添加到 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) 将以下行添加到 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) 单独保留 c:\xampp\apache\conf\httpd.conf 中的 DocumentRoot、Directory 等来完成此操作。作为参考,这些行将是:
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>