Home > Article > Backend Development > How to set a virtual domain name in php
How to set a virtual domain name in php: 1. Edit the httpd.conf file and uncomment the virtual hosts; 2. Edit the httpd-vhosts.conf file and configure the virtual domain name; 3. Redirect; 4. Bind hosts ;5. Restart the apache server.
The specific steps are as follows:
(Learning video recommendation: java video tutorial)
1 , find the apache configuration file httpd.conf
2, in D:\wamp\bin\apache\Apache2.2.21\conf\extra\httpd-vhosts.conf
3. Redirect, otherwise a 403 error will occur when accessing other projects
4. Find C: \Windows\System32\drivers\etc\hosts
#5. Finally, restart the apache server
so that the virtual domain name you configured can be accessed, use "127.0 .0.1" or "localhost" can access other projects!
Related recommendations: php training
The above is the detailed content of How to set a virtual domain name in php. For more information, please follow other related articles on the PHP Chinese website!