我正在一个 Drupal 站点上工作,我将其检出 (svn) 到我的本地主机.
I am working on a drupal site which I checked out (svn) to my localhost.
现在的问题是,当我去:
Now the problem is that when I go to:
http://www.site.com
一切正常,但是当我去:
it all works fine, but when I go to:
http://localhost/work/site
我被重定向到
http://www.localhost.com/work/site
我已经运行了 install.php 脚本并且一切正常.它会重新安装所有内容,但是当我转到主站点时会发生重定向.
I have ran the install.php script and all works great. It reinstalls everything but when I go to the main site the redirect occurs.
我删除了 .htaccess 文件,什么也没做.
I removed the .htaccess file, didn't do anything.
我使用的是 windows 7 Ultimate 64(也在 winxp pro 32 上试过)apache 2.2、php 5.2.13
I am using windows 7 ultimate 64 (also tried on winxp pro 32) apache 2.2, php 5.2.13
有人知道解决这个问题吗?
Anyone know anyway to fix this?
谢谢
重定向是由于 Firefox 无法与本地服务器建立良好连接,然后尝试修复"地址造成的.您可以按如下方式禁用 Firefox 中的行为:
The redirect is caused by Firefox not being able to get a good connection with the local server and then trying to "fix" the address. You can disable the behavior in Firefox as follows:
然而,这并不能解决您的潜在问题(本地服务器没有正确响应),它只会摆脱真正令人讨厌的行为.导致此失败的可能原因有多种,MatW 建议的主机文件问题是一个常见原因.
However that will not solve your underlying problem (local server isn't responding right), it will just get rid of really annoying behavior. There are several possible causes of this failure, the host file problem MatW suggested is a common cause.
在我的情况下,Drupal 似乎在某些页面加载期间使 Apache 崩溃,当您的浏览器不断将自身重定向到远离您需要刷新的页面时,这很难诊断/修复.
In my case Drupal seems to be crashing Apache during certain page loads, which is hard to diagnose/fix when your browser keeps redirecting itself away from the page you need to refresh.
这篇关于Drupal localhost 重定向到 www.localhost.com的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!