1.打开C:/windows/system32/drivers/etc/hosts
添加127.0.0.1 www.yourwebsite.com

# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost

127.0.0.1       www.yourwebsite.com

2.打开本地apache配置文件/apache/conf/httpd.conf
找到Include "conf/extra/httpd-vhosts.conf" 集成工具会有这个,若没有跳过这步

<VirtualHost 127.0.0.1:*>
 ServerName www.yourwebsite.com
 DocumentRoot "/xampp/xampp-portable/htdocs/yourwebsite"
    <Directory "/xampp/xampp-portable/htdocs/yourwebsite">
        Options FollowSymLinks IncludesNOEXEC Indexes
        DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml
        AllowOverride All 
        Allow from all 
    </Directory>
</VirtualHost>

OVER


MockingBird
5.8k 声望743 粉丝