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:
Here’s hoping I remember to check my blog next time, before spending hours staring at log files and useless search results.