Activity Stream
48,167 MEMBERS
62133 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 5 of 5
  1.     
    #1
    Member

    Default password protect a single file ?

    I want to make a text file (located under /home/public_html) to be viewable through a browser by me only.
    One way is to make it password protected, I know how to do this through cpanel for a directory but I don't know how to do it for a single file, also I don't want to move the file in to a private directory because the file already been used in many places ?

    any idea ?
    Tigger Reviewed by Tigger on . password protect a single file ? I want to make a text file (located under /home/public_html) to be viewable through a browser by me only. One way is to make it password protected, I know how to do this through cpanel for a directory but I don't know how to do it for a single file, also I don't want to move the file in to a private directory because the file already been used in many places ? any idea ? Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    felonygames.com
    1. Open a new text file called
      .htpasswd
      Note the period at the beginning of the filename
    2. Use a password encryption program to create your passwords. Paste the lines into your .htpasswd file and save the file. You will have one line for every username that requires access
    3. Upload the .htpasswd file to a directory on your Web server that is not live on the Web. In other words, you should not be able to go to http://YOUR_URL/.htpasswd - it should be in a home directory or other location that is secure.
    4. Then you need to create your HTaccess file for the file you want to protect. Open a text file called
      .htaccess
    5. Add the following to the file:
      AuthUserFile /path/to/htpasswd/file/.htpasswd
      AuthName "Name of Page"
      AuthType Basic
      <Files "mypage.html">
      require valid-user
      </Files>
    6. Change
      /path/to/htpasswd/file/.htpasswd
      to the full path to the .htpasswd file you uploaded in step 3.
    7. Change
      "Name of Page"
      to the name of the page being protected.
    8. Change
      "mypage.html"
      to the filename of the page you're protecting.
    9. Save the file and upload it to the directory of the file you want protected.
    10. Test that the password works by accessing the URL. If your password doesn't work, go back to the encryption programs and encrypt it again, remember that the username and password will be case-sensitive. If you are not prompted for a password, contact your system administrator to make sure that HTAccess is turned on for your site.


    Source
    http://webdesign.about.com/od/security/a/aa020801c.htm

  4.     
    #3
    Member
    Thank you for the info,
    I will follow the instructions then.

  5.     
    #4
    Member
    Thanks for the info bmoeller.
    Trusted buyers: warezfreak09, aishamontreal, gamelord, gruby4678, sharesz, ancient, wCruiser, madsnipper.

  6.     
    #5
    Member
    Website's:
    felonygames.com
    Not a probelm

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to password protect a folder in cPanel
    By Areon in forum Server Management
    Replies: 0
    Last Post: 1st Mar 2014, 04:04 PM
  2. Replies: 12
    Last Post: 20th Dec 2011, 01:24 AM
  3. Help me in joining MPG files into a single MKV file
    By Froomple in forum Technical Help Desk Support
    Replies: 6
    Last Post: 6th Oct 2011, 07:59 PM
  4. Need Password Protect Program
    By cotufa-ssdd in forum Technical Help Desk Support
    Replies: 4
    Last Post: 17th Sep 2011, 05:02 AM
  5. Password Protect Directories
    By FancyPants in forum phpBB
    Replies: 6
    Last Post: 25th Jan 2010, 12:26 AM

Tags for this Thread

BE SOCIAL