1. hosts file C:\Windows\System32\drivers\etc
Add the following code:
127.0.0.1 www.blog.com
127.0.0.1 blog.com
2. Modify the httpd.conf file in Apache
Include conf/extra/httpd-vhosts.conf remove the preceding ' # '
3. Find the httpd-vhosts.conf file (-)
Then add the following
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "F:\web\www\laravel\blog\public\index.php" // This is your project directory
ServerName www.blog.com // This is configured in the host for you
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
The meaning of directories in Httpd.conf :
http://blog.csdn.net/u011685720/article/details/48680203
httpd-vhosts.conf has a line above it
<VirtualHost _default_:80>
DocumentRoot "${SRVROOT}/htdocs"
Change DocumentRoot "${SRVROOT}/htdocs" to DocumentRoot "F:\web\www" (your own defined web root directory)
Open your browser and visit www.blog.com