更改在.htaccess重写规则不生效

编程入门 行业动态 更新时间:2024-10-25 01:34:43
本文介绍了更改在.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 ^(.*) example/PHProxy/poxy-0.5b2/index.php?url=example/mypage [L,R=302,NC]

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

However, when I change the url in the RewriteRule to example/PHProxy/poxy-0.5b2/index.php?url=example/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重写规则不生效

本文发布于:2023-11-16 18:22:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1606699.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重写   规则   htaccess

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!