Apache URL resolution – serve html file as directory

Palimondo asked:

I’ve changed my web hosting provider and now I have a configuration problem:
In the root of my site, I have a file called beta.html. The Apache configuration on previous webhost would serve its content even if accessed as http://example.com/beta or http://example.com/beta/. The Apache on the new webhost treats those two cases as 404 error. Note that there is no directory named beta on that site.

Is there something I can do with .htaccess so that it serves the contents of beta.html without a client side redirect?

My answer:


Enable MultiViews for the Directory in question.

<Directory /my/web/site>
    Options MultiViews # and your other options
</Directory>

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.