views:

150

answers:

2

Hello,

I have a url that is easily accessible when you request it as:

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

    or

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

(I actually don't know why it works without the extension. Instead, it should return the usual 404 error.)

However, when I try to access the following url:

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

I get a 404 Not found error but with the requested url printed as:

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

So, it seems the ".html" part was automatically added by apache.

My question is: how do I disable this behavior? I need to do it because I want add mod_rewrite rules to hide the html extension, so that I can access that url as:

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

My apache is 2.2.9 on Ubuntu 8.10.

Thanks!

+4  A: 

MultiViews could cause this behavior. Try to disable it:

Options -MultiViews
Gumbo
That was exactly the cause, the behavior dissappeared upon adding that configuration (I googled for a bit but couldn't find anything similar to my issue) Thanks a lot.
Favio
A: 

Is example.html an actual file that lies in the directory path 2005/01? It seems like mod_rewrite is already active. If you use a blog or content management system on your server, then it probably does stuff to your url's already.

Marius
Yes example.html is an actual file. I'm actually trying out Jekyll which is a static file generator, so I had no rewrite rules, but now is time to add them. Thanks.
Favio