Several of you noticed last week that when I shared a new blog post on social media the link resulted in an HTTP 404 (page not found). I attributed it to the fact that I had written the post before I switched from the WordPress plain link style (e.g. “/?p=123”) to a longer style (“/2016/11/06/sample-post/”) and figured the plugin to publicize it didn’t handle that change correctly. But the link was correct, so what was it?
It turns out to be a security feature. I set the .htaccess file to be read-only. This is generally a good idea, but it caused a problem. When I changed the permalink setting, WordPress wasn’t able to write the necessary changes. As it turned out, WordPress was kind enough to let me know about this, but in a very unobtrusive way.
Below the “Save Changes” button, the WordPress settings page displayed this message:
“If your
.htaccessfile were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your.htaccessfile. Click in the field and press CTRL + a to select all.”
Of course, since it was below the save button, I didn’t even look at it. Only after I broke links to the blog posts in a very public manner did I notice what I had done. I blame myself mostly, but I also blame WordPress a tiny bit. “I can’t actually do what you told me to do” seems to merit a more in-your-face message. Big, red text or a popup dialog would have made it clear that I had more work to do.
But in the end, I was able to fix it quickly. Only two people said they noticed, and it’s not like I have more than a handful of page views on a given day anyway. Plus, I got this blog post out of the ordeal.