Home  >  Article  >  Backend Development  >  How to configure virtual domain name in php

How to configure virtual domain name in php

王林
王林Original
2021-05-12 16:27:452329browse

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.

How to configure virtual domain name in php

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

How to configure virtual domain name in php

Then in D:\wamp\bin \apache\Apache2.2.21\conf\extra\httpd-vhosts.conf

How to configure virtual domain name in php

then redirect, otherwise a 403 error will occur when accessing other projects

How to configure virtual domain name in php

Continue to find C:\Windows\System32\drivers\etc\hosts

How to configure virtual domain name in php

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn