开发者

Firefox work offline with virtual host

开发者 https://www.devze.com 2023-03-09 16:31 出处:网络
So I have an offline website on my PC that I want to test in Firefox. I would like to do it in the offline mode.

So I have an offline website on my PC that I want to test in Firefox. I would like to do it in the offline mode.

The problem is, I have defined a virtual host for the website in httpd.conf Apache configuration file like this:

<VirtualHost 127.0.0.1>
   DocumentRoot "D:\data\o\WebProjects\website\public"
   ServerName website
</V开发者_Go百科irtualHost>

When in online mode, I can go to http://website/ and test it normally. However it does not work in offline mode. Any hack around this?


I don't think in offline mode FF will bother to open any TCP connection (not even so with localhost). Try opening http://127.0.0.1 in offline mode. If it fails then no chance.


Did you try to put the URL in hosts file?

127.0.0.1       localhost www.xyz.com 

The host file, in Windows, is in C:\Windows\System32\drivers\etc, while in Linux it is usually place in /etc/hosts.conf.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号