Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Weird apache behavior when trying to display urls without html extension

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!

like image 1000
Favio Avatar asked Dec 06 '25 06:12

Favio


1 Answers

MultiViews could cause this behavior. Try to disable it:

Options -MultiViews
like image 73
Gumbo Avatar answered Dec 08 '25 03:12

Gumbo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!