Because manyProgramDuring development, developers will create a folder under the website directory specified by Apache to put the website. When testing on the local machine, they enter http: // 127.0.0.1/web1/to access the website, however, the domain name is used after the website is uploaded, which may cause incorrect paths.
Solution:
Find the hosts file in the c: \ windows \ system32 \ drivers \ etc directory, open it in text, and add a sentence in it
127.0.0.1 emtit.com
In this way, you can use www.emtit.com to access your website without a DNS server, but it cannot reach your virtual directory and open httpd of Apache. in the conf configuration file, add the followingCode
Copy codeThe Code is as follows: namevirtualhost *: 80
<Virtualhost *: 80>
Serveradmin hjwtp2005@163.com
DocumentRoot/flashgame
Servername emtit.com
Serveralias www.emtit.com
Errorlog @ rel_logfiledir @/dummy-host.example.com-error_log
Customlog @ rel_logfiledir @/dummy-host.example.com-access_log common
</Virtualhost>
In this way, you can access the local website just like accessing the Internet without DNS.