步骤:
1、修改hosts文件
目录:C:\Windows\System32\drivers\etc
127.0.0.1 www.ts.com
添加虚拟域名
2、修改httpd.conf文件(点击wamp可直接找到该文件)
开启伪静态:LoadModule rewrite_module modules/mod_rewrite.so
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
allow from all
</Directory>
Options FollowSymLinks
AllowOverride All
Order deny,allow
allow from all
</Directory>
AllowOverride all
# onlineoffline tag - don't remove
Order Deny,Allow
Allow from all
Order Deny,Allow
Allow from all
3、修改httpd-vhosts.conf文件
D:\wamp\bin\apache\apache2.2.22\conf\extra
<VirtualHost *:80>
DocumentRoot "D:/wamp/www/tianshi/public"
ServerName www.ts.com
</VirtualHost>
添加路径
DocumentRoot "D:/wamp/www/tianshi/public"
ServerName www.ts.com
</VirtualHost>
添加路径