How to change the URL from “localhost” to somethin

2019-01-10 06:04发布

On a Windows machine, there's a system running on the local wampserver, but while the application is running on localhost, the URL says otherwise.

While I would expect the URL to be like this based on the directory structure:

http://localhost/pro/include/db_report.php

The developer has managed to do this:

http://ap-mispro/pro/include/db_report.php

So instead of localhost, the URL says ap-mispro.

And both URLs work fine.

How is the second URL made? I tried checking out the wampmanager.ini and wampmanager.tpl but maybe I didn't know what to look for?

7条回答
倾城 Initia
2楼-- · 2019-01-10 06:29

go to C:\Windows\System32\drivers\etc and open hosts file and add this

127.0.0.1    example.com
127.0.0.1    www.example.com

then go to C:\xampp\apache\conf\extra open httpd-ajp.conf file and add

<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/pojectroot"
    ServerName example.com
    ServerAlias www.example.com
    <Directory "C:/xampp/htdocs/projectroot">
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>
查看更多
登录 后发表回答