xampp如何设置多虚拟主机访问
D:/xampp/htdocs/sign
如果我想访问sign/目录,地址栏:localhost/sign是不是很麻烦?直接www.sign.com是不是更简单一点!直接进入操作步骤:
前提:1、会安装xampp
2、前两步是在关闭apache下进行的
1、添加httpd-vhosts.conf虚拟主机文件
打开文件,在最后添加一段话:
<VirtualHost *:80>
ServerName www.sign.com
DocumentRoot "D:/xampp/htdocs/sign"
<Directory "D:/xampp/htdocs/sign">
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.htm index.php
AllowOverride all
Order Deny,Allow
Allow from all
Require all granted
</Directory>
</VirtualHost>
2、添加hosts文件路径配置
将hosts快捷方式发送到桌面,便于后面访问:
127.0.0.1 www.sign.com