Skip to main content

htaccess file is wiped out after running pkgacct

Comments

10 comments

  • andrew.n
    Make sure the htaccess files has the correct permissions and ownerships which in most of the cases causing the problem.
    0
  • Optimizr
    Make sure the htaccess files has the correct permissions and ownerships which in most of the cases causing the problem.

    Both of them are correct. Permission is 666 and the owner is the respective cPanel user. Any other possible reason?
    0
  • andrew.n
    @cPRex ? @Optimizr can you paste here or attach the full backup logs? so we can see what else it can be.
    0
  • George_Fusioned
    chmod 666 means that all users can read/write this file. The proper permissions are 644 for files, 755 for folders. You can perform a bulk change of permissions by running the following while in the public_html
    folder. find . -type d -exec chmod 0755 {} \; find . -type f -exec chmod 0644 {} \;
    (that said, I don't know why having the "wrong" permissions would empty your .htaccess file, so yeah definitely something that the cPanel techs need to take a closer look)
    0
  • cPRex Jurassic Moderator
    I haven't experienced this issue on my end. Could you provide us with a copy of the data in one of the .htaccess files that is being overwritten so I can do some testing with that on my side?
    0
  • Optimizr
    @Optimizr can you paste here or attach the full backup logs? so we can see what else it can be.

    I am sorry I am redirecting the log to > /dev/null 2>&1;
    since it has been running fine for a long time.
    0
  • Optimizr
    chmod 666 means that all users can read/write this file. The proper permissions are 644 for files, 755 for folders. You can perform a bulk change of permissions by running the following while in the public_html
    folder. find . -type d -exec chmod 0755 {} \; find . -type f -exec chmod 0644 {} \;
    (that said, I don't know why having the "wrong" permissions would empty your .htaccess file, so yeah definitely something that the cPanel techs need to take a closer look)

    Thank you for pointing out. When @andrew.n mentioned this I just had a quick check on other working file and they are also at 666 permission. That's why I though 666 was intentional for htaccess (although I know 644 is recommended for files). I will run a quick fix for all those htaccess file and will get back with the outcome. My backup is running on alternate days. Therefore, forgive me if my reply is taking a while.
    0
  • andrew.n
    Nice, keep us updated!
    0
  • Optimizr
    Looks like fixing the permission of .htaccess did the magic. I only have one emptied .htaccess file today which I must have left out while fixing the permission. Thank you all for your helps. Have a good day ahead!
    0
  • andrew.n
    Glad to hear!
    0

Please sign in to leave a comment.