Xxamp
Open the computer's host file, specific directory: C:/WINDOWS/SYSTEM32/DRIVERS/ETC;
Add the following code at the bottom:
127.0. 0.1 Www.test.com #www. test.com for the name you want to set;
Save the file.
Then open the Xxamp in the Apache configuration file httpd.conf, the specific directory:/xampp/apache/conf; the command to configure the virtual host opens.
# Virtual Hostsinclude conf/extra/httpd-vhosts.conf #将前面的 # removed;
Save the file.
Open the virtual host profile httpd-vhosts.conf, the specific directory:/xampp/apache/conf/extra; Configure the virtual host, copy the code, paste it to the end of the file.
<virtualhost *:> ServerName www.test.com #此网站为你想设置的网址名称, must be the same as the host file ; " d:/xampp/htdocs/test "#此目录为项目目录 " d:/xampp/htdocs/test "> #此目录为项目目录 must be the same as above; directoryindex index.php index.html index.htm Options Index Es followsymlinks #支持Rewrite重写 allowoverride all Order deny,allow from All </Directory></VirtualHost>
Save file, restart apache! Restart apache! Restart apache! The important thing to say three times.
You can access your website by opening the www.test.com URL on your browser.
This method pro-test is suitable for Xxamp environment configuration Virtual host, the system is 64-bit WIN10 system, other integrated environment such as WAMP wait to be tested!
(To be Continued ...) )
Configure Apache Virtual Host