Apache MultiViews automatically appends .html, but I don’t want it to

Hat-tip to Abdel-Karim Mardini for reminding me which Apache directive is poison. It’s Options MultiViews.

A client reported that WordPress pages weren’t working. For example, example.com/press/ was showing a 404, even though WordPress had a page with that permalink. What was strange was that example.com/press was showing a very old version of the correct page, which was stored on the file system as press.html.

I checked the code on my local server and looked through the apache log files. No help. I deleted all the directives from .htaccess. It was still happening. But I vaguely remembered that Apache “automagically” appends .html to certain URLs. Google was very little help, mostly showing me how to write apache rewrite rules. But since I had disabled .htaccess, I knew that wasn’t it.

I finally found Abdel-Karim’s summary, and sure enough, appending this to my .htaccess file, worked:

Options -MultiViews

Here’s hoping I remember to check my blog next time, before spending hours staring at log files and useless search results.

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s