简体   繁体   English

mod_rewrite - Apache是​​否缓存.htaccess规则? (即使在删除.htaccess文件后仍遵循规则)

[英]mod_rewrite - Does Apache caches .htaccess rules? (still follow rules even after deleting the .htaccess file)

I was doing some tests with mod_rewrite in my wamp environment. 我在wamp环境中使用mod_rewrite进行了一些测试。

I tested a simple rule that I put at the root of one of my websites and asked it to redirect any request ending with index.php to localhost (there is no sense to it, just wanted to check the rule) 我测试了一个简单的规则,我把它放在我的一个网站的根目录,并要求它将任何以index.php结尾的请求重定向到localhost(没有任何意义,只是想查看规则)

It worked, but after, any change I'd made to my .htaccess file rule was not reflected. 它工作,但之后,我对.htaccess文件规则所做的任何更改都没有反映出来。 After a while I just decided to delete the .htaccess... well it's still doing redirection! 过了一会儿我就决定删除.htaccess ......好吧它还在重定向! I just don't understand it. 我只是不明白。 Does Apache cache the rules or something (restarting services trough wamp menu didn't change anything) Apache是​​否缓存规则或某些东西(通过wamp菜单重新启动服务并没有改变任何东西)

(Don't ask for the exact rule I used, since I deleted the file, I don't think it's relevant anyway) (不要问我使用的确切规则,因为我删除了文件,我认为无论如何都不相关)

.htaccess files are processed each time a request comes through . 每次请求发出时都会处理 .htaccess文件。 It is possible that your browser cached the request being forwarded. 您的浏览器可能会缓存转发的请求。 Did you try it with httpfox or anything to see what the headers said? 您是否尝试过使用httpfox或其他任何内容来查看标题所说的内容?

您是否尝试删除浏览器缓存?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM