htaccess 文件以某种方式被缓存? [英] htaccess file somehow being cached?

查看:27
本文介绍了htaccess 文件以某种方式被缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 .htaccess 文件,对页面名称进行了非常简单的重写.这是文件的内容:

I had a .htaccess file doing a very simple rewrite of the page names. This is the contents of the file:

Options +FollowSymlinks
RewriteEngine on
RewriteRule setup setup.php [NC]

我现在想停止将设置重写到 setup.php - 我该怎么做?我试过从文件中删除该行,我试过删除文件并重新启动 apache,但它仍然 将设置重写为 setup.php.我如何让它停止?它似乎完全忽略了我创建的任何其他 .htaccess 文件,并且没有任何内容写入错误日志.它是否将文件缓存在某处?我该如何阻止?

I now want to stop rewriting setup to setup.php - how do I do this? I've tried removing the line from the file, I've tried deleting the file and restarting apache, and it is still rewriting setup to setup.php. How do I make it stop? It seems to be completely ignoring any other .htaccess file I create, and there's nothing being written to the error log. Is it caching the file somewhere? How do I stop it?

我在 ubuntu 上使用 apache2.

I'm using apache2 on ubuntu.

推荐答案

问题在于启用了 MultiViews.如果可能,MultiViews 会自动向任何请求的 URL 添加扩展.这与您的 RewriteRule 无关;碰巧您正在将 setup 重写为 setup.php,所以 MultiViews 和您的规则正在做同样的事情.

The problem is that MultiViews is enabled. MultiViews automatically adds extensions to any requested URLs, if possible. This has nothing to do with your RewriteRule; it just so happens that you were rewriting setup to setup.php so MultiViews and your rule were doing the same thing.

-MultiViews 添加到 Options 指令以禁用它.

Add -MultiViews to the Options directive to disable it.

这篇关于htaccess 文件以某种方式被缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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