Wordpress htaccess wiped out

One of my reclaim hosted WordPress mulisites recently was returning 404 on all links to any of the sub sites (st up directory based).

Following a hunch I noticed the the site’s htaceess file had ben wiped out of the code multisite generates and only include what looks like cpanel generated htaccess for PHP issues-- this was the entirery of my WordPress site htaccess:

I hope this was a one time error, as I imagine for many users thy would not know where to check. If cpanel is adding to an htacess file should it not first save a back up of the file it is replacing?

Posted here more as a reference in case others find this happening.

Great question! This is likely from a recent migration for the account in particular. We are performing migrations for all of our servers to newer infrastructure and we’ve discovered a bug where the .htaccess isn’t included in the cPanel transfer from the old server.

This has since been patched so we shouldn’t see the file removed during the migration.

If you do see a missing .htaccess, you can always check the application’s repository through GitHub to grab a default copy of the file.