WordPress keeps deleting .htaccess file

Recently my wordpress site has been experiencing problems with all pages returning a 404 error.

I tracked this down to the fact the .htaccess file in my wordpress directory keeps disappearing.

When I go to the Permalinks page and re-save it, the .htaccess file appears again – only for it to be deleted a few minutes later.

Any idea what could be doing this? It’s very frustrating!

1 Answer
1

You can give the read-only rights to .htaccess to prevent it from the modifications or removal.

$cd <your website directory>
$chmod 400 .htaccess

Leave a Comment