How to ensure precedence of files over directories with Apache?

Posted by janeden on Server Fault See other posts from Server Fault or by janeden
Published on 2011-11-20T14:12:26Z Indexed on 2011/11/21 9:56 UTC
Read the original article Hit count: 183

Filed under:

My httpd.conf uses the MultiViews option to serve HTML files for URLs like http://server/blog. This works fine, unless there are directories with the same name – Apache will then try to serve the directory.

Is there any way to ensure precedence of blog.html over blog/, or rather: can I make Apache process content negotiation according to MultiView although a matching entity (the directory) is present?

In nginx, I can do this explicitly:

try_files $uri $uri.html $uri/ =404;

© Server Fault or respective owner

Related posts about apache2