How to set a file so that I can't delete it

Username epiz_27148879 site


I have added a .htaccess file to my domain

I want to ensure that I don’t delete it accidentally. Can I do this in File Manager ? What do I need to set the permissions to for this ?

(other information and details relevant to your question)

You can change the permissions of the file (CHMOD) to remove write access for the owner (like 0444).

BUT, this means you can NEVER make ANY changes to this file EVER AGAIN. Want to make it editable again? You can’t. Want to make changes? You can’t. Want to delete it on purpose? You can’t.

There isn’t really a way to protect a file against accidental changes, but still allow intentional ones.

It’s your site, but I would personally just make sure I have a backup of the files and just be careful when making changes to the site.


OK. Makes sense.


This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.