Today I configured the virtual directory, the following is my configuration method.
1 edit httpd.conf, find include conf/extra/httpd-vhosts.conf, delete the previous comment symbol "#".
2 Edit httpd-vhosts.conf, I put wampserver installed in D:/wamp, so my path here is D:\wamp\Apache2\conf\extra.
Empty or annotate the contents, and replace them with the following:
Namevirtualhost *:80
This is the new effort directory.
<virtualhost *:80>
ServerName www. cms. com
Serveralias www. cms. com
DocumentRoot "F://workplace"
</VirtualHost>
The original default directory
<virtualhost *:80>
ServerName localhost
Serveralias localhost
DocumentRoot "D:/wamp/www"
</VirtualHost>
3 edit httpd.conf, find DocumentRoot "d:/wamp/www/" This, this is the default root directory path, but to change is not this, keep looking down, find <directory "d:/wamp/www"; After </Directoory>, add the following content:
<directory "F://workplace" >
Options Indexes FollowSymLinks
AllowOverride All
Order Allow,deny
Allow from all
</Directory>
<directory "D:/wamp/www" >
Options Indexes FollowSymLinks
AllowOverride All
Order Allow,deny
Allow from all
</Directory>
4 Modify C:/windows/system32/drivers/etc/host This file, open with Notepad, add the following:
127.0.0.1 www. CMS. com
OK, then restart Apache and enter WWW in the browser. CMS. com, to see if the content of the access is workplace this directory.