请问apache的缓存的.htaccess规则?重定向存在即使我删除该文件 [英] Does apache cache .htaccess rules? redirections exist even after I delete the file

查看:141
本文介绍了请问apache的缓存的.htaccess规则?重定向存在即使我删除该文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的删除了文件中的所有扩展名为.php .htaccess文件,所以如果我去到localhost /路径/要/文​​件重定向到l​​ocalhost /路径/要/ file.php一切都工作得很好,直到我决定一个新的规则添加到htaccess的,它是行不通的。

I had a .htaccess file that removed all the .php extensions from the files, so if I go to localhost/path/to/file it redirects to localhost/path/to/file.php Everything worked just fine untill I decided to add a new rule to the .htaccess and it wasn't working.

我删除.htaccess文件在我的主文件夹,并检查,如果一些其他文件夹用命令存在:CD的/ var / www和再LS -laR |的grep的.htaccess我发现没有存在过。然而,重定向规则仍在后面!

I deleted the .htaccess file in my home folder and checked if some exist in other folders with the command: cd /var/www and then ls -laR | grep .htaccess and I found none existed. However the redirection rules are still being followed!

我试图清除所有浏览器的缓存,仍然没有工作,我尝试卷曲,仍然遵循阿帕奇删除的.php文件的扩展名的原始规则。我下载的HttpFox扩展,Firefox和它给我看我做了到localhost /项目名称/指数和内容定位是的index.php的要求。我试图无休止地重新启动Apache并没有运气。

I tried to clear all of my browser's cache and still didn't work, i tried cURL and still apache followed the original rule of removing .php extensions of the files. I downloaded httpfox extension to firefox and it showed me the request I made to localhost/projectname/index and the "Content-Location" is "index.php". I tried endlessly to restart apache and with no luck.

如何才能摆脱缓存的htaccess规则?

How can I get rid of the "cached" htaccess rules?

编辑:我想在我的iPad和我的移动设备,目前仍是问题仍然存在,所以我相信规则正在某处保存

I tried on my iPad and my mobile device and still the problem persist, so I am sure the rules are being saved somewhere

编辑:我添加了一个规则来删除的.html以及和它的工作,但是当我抹去它的规则仍然存在,.php为之一,也是

I added a rule to remove .html as well and it worked, but when I erased it the rule is still there and the .php one as well.

推荐答案

没有,.htaccess文件不缓存,默认情况下还是其他方式。 (也就是说,有没有办法让Apache的缓存.htaccess文件。)在每一个请求他们重新阅读。

No, .htaccess files are not cached, by default or otherwise. (ie, there's no way to get Apache to cache .htaccess files.) They are re-read on every single request.

然而,有其他地方重定向将被缓存,包括浏览器,浏览器和服务器之间的中间代理。

However, there's other places where a redirect will be cached, including your browser and any intermediate proxies between your browser and the server.

和,不,你不需要重新启动Apache,以便待观察.htaccess文件的更改。

And, no, you don't need to restart Apache in order for .htaccess file changes to be seen.

这篇关于请问apache的缓存的.htaccess规则?重定向存在即使我删除该文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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