PDA

View Full Version : htaccess files to prevent unauthorised users accessing admin


phillip
05-13-2004, 08:07 PM
Good Evening, My name is Phillip and I am here to assist all clients, if you have an issue please contact me phillip@digitalhost.net

Keep unwanted visitors from accessing your admin files on the server.

Login to your Cpanel, Go to file manager, enter the directory you wish to protect, create a blank txt file and name it .htaccess

open the file, inside put this code

order deny,allow
deny from all
allow from put.your.ip.address.here

and save.

* remember this file will affect all directories above its location, meaning if you place this file in the root directory of your website only your IP address will be able to access any files on your website, if you make a mistake, contact support@digitalhost.net and request they remove the .htaccess file for you.

James
09-15-2004, 05:47 PM
Hey Phillip good on you for letting others know.

There is another way of protecting your directories and this is done very easily using your CPanel.

Login to your CPanel click on the Password Protect Directories link

From there click on the "Folder Name" in which you want to be protected from users you don't want in there.

Next under "Active Users" put in a Username and Password followed by clicking on the "Add/modify autherized user" and when done in the Protected Resource Name (will display in browser's password mask): text box add a message like Username/Password Required and tick the Directory requires a password to access via the web (you must check this to activate password protection) box and click on the "Save" button and that's it your done.

Next time you want to access a certain area you will be asked for a username and password.