更改在.htaccess重写规则不生效 [英] Changes to RewriteRule in .htaccess not taking effect

查看:302
本文介绍了更改在.htaccess重写规则不生效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个重写规则设立的的.htaccess ,这是所有工作的罚款...

I had this rewrite rule set up in .htaccess and it was all working fine...

Options +FollowSymLinks +ExecCGI
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/mypage(.*)$ [NC]
RewriteRule ^(.*) http://example.com/PHProxy/poxy-0.5b2/index.php?url=http://example.org/mypage [L,R=302,NC]

然而,当我更改URL的重写规则来 <$c$c>http://example.com/PHProxy/poxy-0.5b2/index.php?url=http://example.org/mypage它仍然重定向到旧的URL。

However, when I change the url in the RewriteRule to http://example.com/PHProxy/poxy-0.5b2/index.php?url=http://example.org/mypage it still redirects to the old URL.

经过一番研究,我添加了一个语法错误到.htaccess文件,查看正在使用.htaccess文件(实际上是 - 因为它导致了内部服务器错误,当你试图从该目录加载一个页面)。

After some research, I added a syntax error into the .htaccess file to check the .htaccess file was being used (and indeed it was - as it resulted in an Internal Server Error when you tried to load a page from that directory).

似乎有一些缓冲的地方,但我不知道。任何想法,为什么我的变化不被拾起/如何排查并解决?

There seems to be some caching somewhere, but I'm not sure. Any ideas why my change is not being picked up / how to troubleshoot and resolve?

推荐答案

问题解决了。只是注意到,有一个我的空间子目录中仍包含旧重写规则,所以这是正在执行的之一。

Problem solved. Just noticed that there is a mypage subdirectory which still contained the old rewrite rule, so that was the one being executed.

这篇关于更改在.htaccess重写规则不生效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆