错误的重定向行为 [英] Erroneous redirect behaviour
问题描述
我坚持着一个问题,因为我无法找到造成这种现象的原因。
I'm stuck with a problem as I can't find the reason causing such a behaviour.
在短期的问题: 我有一个网站。当我去 http://mysite.com - 加载罚款。该网址不会改变。 当我去 http://www.mysite.com - 重定向到的 http://mysite.com/index.php/
The problem in short: I have a site. When I go to http://mysite.com - loads fine. The url doesn't change. When I go to http://www.mysite.com - redirects to http://mysite.com/index.php/
起初我曾在.htaccess一些规则,但现在 - 我评论所有的人,因此该行为再现干净的.htaccess
Initially I had some rules in .htaccess, but now - I commented all of them, so the behaviour is reproduced with clean .htaccess.
在codeigniter配置我有:
In config of codeigniter I have:
$config['base_url'] = "http://mysite.com/";
$config['index_page'] = "";
我检查Apache的配置 - 没有发现任何可能的行为是这样的重定向
I checked the apache config - didn't find any redirects that could behave like this.
任何想法从哪里挖?
推荐答案
这是pretty的从我身边愚蠢的 - 只是把它放在这里,也许对别人,这将有助于不会花太多的时间,因为我做了
That was pretty stupid from my side - but just put it here, maybe for someone else that would help not to spend too much time as I did.
问题是,我曾与网站本地版本,最近改变了hosts文件。现在有127.0.0.1子域仅针对主域名写的,但并非如此。
The problem was that I worked with local version of site, and recently has changed the hosts file. Now there was 127.0.0.1 written only for main domain, but not for subdomains.
因此,基本上,当我进入www.site.com我从网站上的量产版下载。 真是愚蠢的错误。
So basically when I entered www.site.com I downloaded from the production version of site. Really stupid mistake.
这篇关于错误的重定向行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!