1, first open the Apache configuration file httpd.conf, and remove the # # # # conf/extra/httpd-vhosts.conf front, enable the virtual host feature
2, the first to configure the localhost, so as to avoid future access to localhost problems, my Wamp project root directory is D:\wamp\www. Add the following information to the configuration file httpd-vhosts.conf under Apache Apache/conf/extra;
DocumentRoot "D:/wamp/www"
ServerName localhost
Options Indexes FollowSymLinks
AllowOverride None
Order Allow,deny
Allow from all
3, configure other project virtual host: For example, configure www.zf.com, open the link to directly access the D:/wamp/www/zf/public directory. "DirectoryIndex index.php" means to access the directory by default open "index.php" file
DocumentRoot "D:/wamp/www/zf/public"
ServerName www.zf.com
DirectoryIndex index.php
"D:/wamp/www/zf/public" >
Options Indexes FollowSymLinks
AllowOverride None
Order Allow,deny
Allow from all
4, modify the host file under C:\Windows\System32\drivers\etc, open with Notepad, add 127.0.0.1 www.zf.com, restart Apache.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service