Saving Permalinks Doesn’t Update .htaccess File – WordPress Bug

Contents of the .htaccess file being empty

There is a bug in the current WordPress version (4.9.1) that prevents the .htaccess file from being updated properly when you save the permalinks. Evidently this bug existed in 4.9, but it is still a problem!

I noticed this over the last week or two. On multiple WordPress sites, when I’ve gone to update the permalink structure, every page returns a 404 not found error. Updating the permalinks is generally the solution to this problem, not the cause!

According to my website host, this is the bug report that tracks this particular problem. However, they claim to have fixed it but I’m still seeing the same problem.


  1. Saving the permalink structure (or, as I’ve been informed, sometimes simply logging in) causes all pages on a site to return a 404 page not found error.
  2. Upon investigation of the .htaccess file, you’ll see that only the #WordPress Start and #WordPress End lines are retained, with nothing between them.
  3. Deleting the .htaccess file and re-saving the structure results in a new .htaccess file with the same problem.

Solution to Permalinks Not Updating .htaccess File

For now, the main solution is to simply edit the .htaccess file manually. As far as I can tell, the only part that should be altered is the portion that allows WordPress to set custom permalinks for each page. This means that you can just add that one line in, and be all set.

Also note that the proper code is generally the same no matter which permalink structure you select within WordPress. This is because, again, the .htaccess code only allows WordPress to dictate the permalinks.

So, this is the code you want to make sure your .htaccess file has:

Obviously if you have custom redirects or commands in your .htaccess, you’ll want to retain those. In fact, you may want to make sure you backup your .htaccess file before doing anything with it.

I’ll update this page once the bug is fixed, but for now, be careful out there!

About Brian Johnson

Brian Johnson is a website developer and designer living in Minneapolis, Minnesota with a passion for code and WordPress. He spends his days building WordPress websites for small businesses, developing new code with the online community, and living life.