SteveRyland

Registered
Jan 8, 2014
2
0
1
cPanel Access Level
Website Owner
Hi there I am using cPanel Linux version and I noticed that my .htaccess file permissions were set to 755. This caused a problem however as my website kept going down due to the file being replaced by one with slightly different coding to make it go wrong. I changed the permissions to 644 however this does not seem to stop it and the permissions automatically change back to 755 every day it seems. Out of frustration I unticked all permissions boxes leaving it at 000 which obviously cause the 403 forbidden error on my website however now the file manager on cPanel is showing as 'Data error' and will not let me see any files so I cannot correct the htaccess permissions. My question to any experts out there is how can I get my htaccess back, and once I do how can I stop it being edited.

This is my first post so if it is in the wrong topic area let me know and I will get it changed.

Thank you in advance.
 

cPanelPeter

Senior Technical Analyst
Staff member
Sep 23, 2013
585
25
153
cPanel Access Level
Root Administrator
Hello,

Do you have shell access? If so, you can type:

Code:
chmod 644 .htaccess
at the command prompt. As for why it is being changed/replaced and permissions set back to 755, that's going to require an investigation.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
Hello :)

You can try modifying the permissions via SSH if you have access. Otherwise, please consult with your web hosting provider to have them complete this for you. cPanel will not automatically modify the permissions of the .htaccess file. It seems like you have a third-party script that is making this change, or your hosting provider has a third-party application making the change.

Thank you.
 

SteveRyland

Registered
Jan 8, 2014
2
0
1
cPanel Access Level
Website Owner
Thank you for the quick replies.

I will access using SSH then and see if I can resolve the problem. I have also contacted my hosting provider as I believe it is a wordpress plugin that may be altering this file.