PDA

View Full Version : HOW TO: Password Protect "pages/files" on your Web Site - STOP SPAM


MXWEBSITES
03-15-2007, 11:31 AM
Ok here is what you can do to password protect the guestbook like www.nickdepalo.com or www.bradleygrahammx.com did. You can do this to any page on your web site.

Log into the control panel and under the system tab just above the WEB SITE EDITOR button there is a button called the FILE MANAGER click that and then open the HTTPDOCS folder you will then see a file called .HTACCESS click on the PENCIL so it takes you to EDIT MODE.

Simply Copy and paste the below code into the file and click ok. (((NOTE where it says <Files page7.php> - BE SURE THIS IS THE NAME OF THE FILE/PAGE YOU WANT TO PROTECT))) Look in the address bar when viewing your web site to see what page your guestbook or page you want to protect is named then adjust the page #.


CODE TO COPY:


php_flag magic_quotes_gpc off
php_flag magic_quotes_runtime off
php_value mbstring.func_overload 4

<Files page7.php>
AuthType Basic
AuthName "Team Page"
AuthUserFile .htpasswd
Require user mxwebsites
</Files>


Now when users try to access the guestbook it will prompt for a user name and password which is SET IN STONE:

User name: mxwebsites
Password: dotcom


HERE IS THE CATCH