虚拟主机重定向到XAMPP文件夹中,但只能通过远程计算机访问时 [英] Virtual host redirecting to the xampp folder, but only when accessing by a remote machine
问题描述
我设置它可以访问从远程/客户机虚拟主机。结果
在我的服务器的机器(Win XP的XAMPP和1.6.7),我的主机文件看起来如下。
I'm setting up a virtual host which can be accessible from a remote/client machine.
In my server machine (Win XP and XAMPP 1.6.7), my host file looks as follows.
127.0.0.1 localhost
127.0.0.1 mysite.dev
我的的httpd-vhosts.conf
如下所示。
NameVirtualHost 127.0.0.1:80
<VirtualHost 127.0.0.1:80>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost mysite.dev:80>
ServerName mysite.dev
ServerAlias mysite.dev
DocumentRoot "C:/xampp/htdocs/mysite"
</VirtualHost>
它正常工作的服务器上,如果我浏览 http://mysite.dev
。但是,远程/客户机上,它一直重定向到 http://mysite.dev/xampp
。
It works fine on the server machine if I browsed http://mysite.dev
. But on the remote/client machine, it keeps redirecting to http://mysite.dev/xampp
.
我在远程机器的主机文件中添加了一行。
I have a line added in the host file of the remote machine.
127.0.0.1 localhost
192.168.1.1 mysite.dev
该IP 192.168.1.1
是服务器机器的IP。结果
任何想法解决这个?
The IP 192.168.1.1
is the server machine IP.
Any idea to solve this?
推荐答案
刚刚重启该死的Apache和你飞。
Just restart the damn Apache and you would be flying.
这篇关于虚拟主机重定向到XAMPP文件夹中,但只能通过远程计算机访问时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!