.htaccess (undeletable how?)

They have: 101 posts

Joined: Apr 2003

hey guys, first of all this isnt a problem.. but im curios, how do you make the .htaccess file and some other files(or all files) in the folder undeeltable using .htaccess?? thanks.

and if you cant use .htaccess what do you use? Laughing out loud

druagord's picture

He has: 335 posts

Joined: May 2003

to make any file undeletable remove write permission to it. If you can't use .htaccess it's because the server admin doesn't thrust you to use it's possibility he probably won't give you another way to use it.

IF , ELSE , WHILE isn't that what life is all about

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

It depends upon the server that you are running. If it is on FreeBSD, then you can set the file flag for it.
chflags uappnd filename (the file can be added to but not deleted)
chflags uunlnk filename (the file cannot be deleted)

Either root or the file owner can set these flags and remove them depending on which SecureLevel you are running.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

druagord's picture

He has: 335 posts

Joined: May 2003

nice to know about this i tested it MacOS X (wich derived from freeBSD) and it works.

They have: 101 posts

Joined: Apr 2003

nonono! I got linux... but i want it so that i couldnt even change the permission on .htaccess in the public_html folder Smiling

druagord's picture

He has: 335 posts

Joined: May 2003

chmod 440 .htaccess
'

but even that will let you change the permission back the only way would be to give ownership to somebody else then you.
by the way could i ask why you would want to do that?

IF , ELSE , WHILE isn't that what life is all about

They have: 101 posts

Joined: Apr 2003

im curious.. but if i chmod it to that.. wil i be able to unchmod it to 644?

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

mohd wrote: im curious.. but if i chmod it to that.. wil i be able to unchmod it to 644?

Yes, you will.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.