Home >Backend Development >PHP Problem >How to configure virtual domain name in php
How to configure the virtual domain name in php: first edit the apache configuration file and uncomment the httpd-vhosts.conf option; then edit the httpd-vhosts.conf configuration file, configure the virtual domain name, and redirect; finally, in Add the domain name to the hosts file and restart the server.
The operating environment of this article: windows10 system, php 7.3&&apache 2.2.21, thinkpad t480 computer.
The specific method is as follows:
First find the apache configuration file httpd.conf
Then in D:\wamp\bin \apache\Apache2.2.21\conf\extra\httpd-vhosts.conf
then redirect, otherwise a 403 error will occur when accessing other projects
Continue to find C:\Windows\System32\drivers\etc\hosts
Don’t forget to restart the apache server in the last step!
In this way, the virtual domain name you configured can be accessed, and other projects can be accessed using "127.0.0.1" or "localhost"!
Related recommendations: php video tutorial
The above is the detailed content of How to configure virtual domain name in php. For more information, please follow other related articles on the PHP Chinese website!