Home > Backend Development > PHP Tutorial > Domain name mapping of Apache on Windows

Domain name mapping of Apache on Windows

WBOY
Release: 2016-07-28 08:26:50
Original
1235 people have browsed it

Find it in Apache's configuration file httpd.conf

LoadModule rewrite_module modules/mod_rewrite.so

LoadModule vhost_alias_module modules/mod_vhost_alias.so


Remove the front #

#Virtual hosts

#Include conf /extra/httpd-vhosts.conf

Remove the first The#
in front of the second line and then find the httpd-vhosts.conf file in the  Windows端Apache的域名映射APacheconfextra


Add the following code

& lt; virtualHost*: 80 & gt;

serveradmin www.test.com

documentsRoot " D:wampserverwwwYIIdigpagedigpagefrontendweb"

ServerName www.test.com

ErrorLog "logs/digpage.log"

CustomLog "logs/digpage.com.log" common

Pay attention to modifying the previous


Then restart Apache
If you develop locally and do not have a domain name  Windows端Apache的域名映射 you can edit the hosts file in the C:WindowsSystem32driversetc
file and add a line in it 127.0.0.1 www.test.com You can write any domain name
because when this machine accesses the domain name, it gives priority to access the one in the hosts file



Note: Different versions of Apache may be slightly different.

The above introduces the domain name mapping of Apache on Windows, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template