Strange 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 really don't know why it works without an extension, instead it should return a regular 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 that the ".html" part has been automatically added by apache.

: ? , mod_rewrite, html, URL :

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

apache 2.2.9 Ubuntu 8.10.

!

+3
2

MultiViews . :

Options -MultiViews
+6

example.html , 2005/01? , mod_rewrite . , , , URL .

0

Source: https://habr.com/ru/post/1703998/


All Articles