How to stop wordpress from changing default .htaccess permissions to 444

I installed my website using an installer – fantastico for a quick install.

Just a few days ago, I started getting a weird error in w3tc plugin and it would ask me to update via ftp as you can see below:

w3tc error message

I found out the file permissions for htaccess have been changed to 444

No matter how many time I try changing it manually, it becomes 444 after a while (about 30 seconds or if I do something in wp dashboard)

 

permissions set to 444 :(

For a while, I am able to rewrite the rules and then the file gets reverted to what you see below:

htaccess reverts to this

I have Hostgator’s shared hosting.

Is there a way to combat this issue?

Edit: I have tried adding ftp details to my wp config too. Didn’t help

2 s
2

Your site has likely been hacked. My site had the Darkleech infection, which injected some malicious code into wp-includes/nav-menu.php, causing .htaccess to reset to 444 on any page load.

I’d recommend you install the Sucuri plugin and let it restore any files that have been corrupted. Assuming your site was hacked, use their Post-Hack tab to reset plugins, passwords, and keys. Also check to make sure another admin user wasn’t created. Use their Hardening tab to secure as much as you can. You could also install Wordfence for more security.

If you make adjustments and the problem keeps coming back, you likely have a root-level breach on your server, and then you have to work with your hosting provider to try to clean out the infection.

Leave a Comment