尝试显示没有html扩展名的网址时出现奇怪的apache行为

Fav*_*vio 3 apache mod-rewrite seo

我有一个网址,当你提出要求时,它很容易访问:

    http://example.com/2005/01/example.html

    or

    http://example.com/2005/01/example

(我实际上不知道为什么它没有扩展.但它应该返回通常的404错误.)

但是,当我尝试访问以下网址时:

    http://example.com/2005/01/example/
    (note the trailing slash)

我收到404 Not found错误,但请求的网址打印为:

    http://example.com/2005/01/example.html/

所以,似乎".html"部分是由apache自动添加的.

我的问题是:如何禁用此行为?我需要这样做因为我想添加mod_rewrite规则来隐藏html扩展名,以便我可以访问该URL:

    http://example.com/2005/01/example/

我的apache在Ubuntu 8.10上是2.2.9.

谢谢!

Gum*_*mbo 6

MultiViews可能会导致这种行为.尝试禁用它:

Options -MultiViews
Run Code Online (Sandbox Code Playgroud)