[Tutorial] How to Password Protect a Directory on Your Website

Results 1 to 7 of 7
  1. #1
    Enthusiast Nito is offline
    MemberRank
    Oct 2008 Join Date
    CanadaLocation
    39Posts

    [Tutorial] How to Password Protect a Directory on Your Website

    System Requirements

    You will need the following before your attempt to password-protect anything is successful.

    1. Your website must be running on an Apache web server. (Recommanded WAMP SERVER)
    2. Your web host must have enabled .htaccess processing - that is, they allow you to customize your web server environment using localized configuration files called .htaccess files.
    3. You must have shell access, either via telnet or Secure Shell (SSH). You should also know how to use telnet or SSH to connect to your web hosting account.

    Step 1 : Create a .htaccess file

    Use an ASCII text editor like Notepad to create a text file with the following contents:


    Code:
    AuthName Put a name like AdminCP
    AuthType Basic = Leave it like this.
    AuthUserFile = Where is your .htpasswd?
    require valid-user = The username you choosed on .htpasswd

    Your .htaccess should be like this:


    Code:
    AuthName "Secure Area"
    AuthType Basic
    AuthUserFile /path/to/your/directory/.htpasswd
    require valid-user
    Step 2: Save and Upload the .htaccess file in the folder you want to protect like admincp.

    Step 3: Set Up the Password File, .htpasswd

    Open Notepad and write the username you want and the password you want like this:

    Code:
    username:password
    Example:

    Code:
    dave:dave

    Save your file has : .htpasswd

    Now upload it in the directory you put .htaccess


    Now you have your directory protected with a username and password


  2. #2
    DRGunZ 2 Creator wesman2232 is offline
    MemberRank
    Jan 2007 Join Date
    Erie, PALocation
    4,872Posts

    Re: [Tutorial] How to Password Protect a Directory on Your Website

    Well a .htaccess file is pretty basic. an easier way is to just put a blank index.php/html/htm or whatever :P but that's really just for folder directorys (not good protection if they know the file name), anything else is better secured by this :P

  3. #3
    Enthusiast Nito is offline
    MemberRank
    Oct 2008 Join Date
    CanadaLocation
    39Posts

    Re: [Tutorial] How to Password Protect a Directory on Your Website

    Thank you for your reply :P

  4. #4
    Account Upgraded | Title Enabled! Kyuma is offline
    MemberRank
    Aug 2008 Join Date
    At HomeLocation
    350Posts

    Re: [Tutorial] How to Password Protect a Directory on Your Website

    Easy.

    But nice for the beginners =)

  5. #5

    Re: [Tutorial] How to Password Protect a Directory on Your Website

    we can do this in the site cpanel..but thnx

  6. #6
    Sultan of Yolo Demantor is offline
    MemberRank
    May 2008 Join Date
    GermanyLocation
    1,266Posts

    Re: [Tutorial] How to Password Protect a Directory on Your Website

    good, but this can be done easier, from the options itself, but nice ^^

  7. #7
    Account Upgraded | Title Enabled! razi46 is offline
    MemberRank
    Dec 2007 Join Date
    697Posts

    Re: [Tutorial] How to Password Protect a Directory on Your Website

    Thanks! I was looking for this!



Advertisement