Wamp: Configure virtual hosts and wamp Virtual Hosts
1. Open the apache configuration file httpd. conf and remove the # Before # Include conf/extra/httpd-vhosts.conf to enable the VM Function
2. Find the apache configuration file httpd-vhosts.conf (My wamp under drive F: \ wamp \ bin \ apache \ Apache2.4.4 \ conf \ extra \ httpd-vhosts.conf, open and add the following at the end of the file:
# Configure the virtual site <VirtualHost *: 80> # website root directory DocumentRoot "F: \ wamp \ www \ test" # domain name ServerName www.test.com # Here configure the welcome homepage # DirectoryIndex index. php <Directory/> Options FollowSymLinks # Do not allow others to modify our page AllowOverride None # Set the access permission order Allow, deny allow from all </Directory> </VirtualHost>
Website root directory: F: \ wamp \ www \ test, test folder, domain name www.test.com (enter this domain name after configuration to open the website under the test directory ), welcome Page, that is, the entry file: index. php. If the project contains index. php does not need to be written here, because the system will automatically find the index of the entry file. php.
3. Modify the hosts file. Path: C: \ Windows \ System32 \ drivers \ etc \ hosts. Add the following at the end of the file:
127.0.0.1 www.test.com
4. Now the configuration is complete. Restart apache and enter www.test.com to enter the configured website.