The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

.htaccess permissions

Discussion in 'General Discussion' started by SteveRyland, Jan 8, 2014.

  1. SteveRyland

    SteveRyland Registered

    Joined:
    Jan 8, 2014
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    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.
     
  2. cPanelPeter

    cPanelPeter Technical Analyst III
    Staff Member

    Joined:
    Sep 23, 2013
    Messages:
    569
    Likes Received:
    15
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,814
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  4. SteveRyland

    SteveRyland Registered

    Joined:
    Jan 8, 2014
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    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.
     
Loading...

Share This Page