如果是phpstudy,可以打开设置vhosts-ini 这个然后复制以下内容
<VirtualHost *:80>
DocumentRoot "D:\phpstudy\PHPTutorial\WWW\project"
ServerName www.fxtceshi.com
ServerAlias fxtceshi.com
<Directory "D:\phpstudy\PHPTutorial\WWW\project">
Options FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
打开host 增加内容
127.0.0.1 www.fxtceshi.com
重启服务,浏览器输入 www.fxtceshi.com 测试