Set a virtual domain name
1. Modify the hosts file, directory: C:WindowsSystem32driversetc, add, for example
localhost doma.com
<Directory /> AllowOverride none Require all denied </Directory>
<Directory /> #AllowOverride none #Require all denied AllowOverride all Order deny,allow Allow from all </Directory>
<VirtualHost *:80> ServerAdmin doma.com DocumentRoot "c:/wamp/www/doma" ServerName doma.com ServerAlias www.dummy-host.example.com ErrorLog "logs/dummy-host.example.com-error.log" CustomLog "logs/dummy-host.example.com-access.log" common </VirtualHost>
However, a problem occurs, accessing localhost, or error reporting in other directories
403 Forbidden You don't have permission to access / on this server
404 Forbidden The requested URL was not found on this server
You need the https-vhosts.cong file, comment out all the
<VirtualHost *:80> ... </VirtualHost>
<Directory /> #AllowOverride none #Require all denied Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Order deny,allow Allow from all </Directory>
The above has introduced the settings of the apache virtual domain name, including the relevant aspects. I hope it will be helpful to friends who are interested in PHP tutorials.