XAMPP添加VirtualHost以支持多个站点
在D:\xampp\apache\conf\extra\httpd-vhosts.conf文件中添加如下内容:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "D:/xampp/htdocs/"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "E:/php/wordpress"
ServerName wordpress
</VirtualHost>
<Directory "E:/php/wordpress">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
在C:\WINDOWS\system32\drivers\etc目录下的hosts文件中添加如下内容:
127.0.0.1 wordpress