IT Community - Software Programming, Web Development and Technical Support

How to make use of .htaccess file to password protect a directory from users

This is a discussion on How to make use of .htaccess file to password protect a directory from users within the PHP Programming forums, part of the Web Development category; How to make use of .htaccess file to password protect a directory from users Htaccess files affect the directory, they ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > PHP Programming

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 07-17-2007, 02:48 AM
bluesky bluesky is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 667
bluesky is on a distinguished road
Default How to make use of .htaccess file to password protect a directory from users

How to make use of .htaccess file to password protect a directory from users

Htaccess files affect the directory, they are placed in and all sub-directories,
i.e., an htaccess file located in your root directory (myexample.com) would affect
yoursite.com/content,
yoursite.com/content/contents, etc.

### BASIC PASSWORD PROTECTION ###

AuthName "CP3024 password example"

AuthType Basic

AuthUserFile /home/staff/acad/jphb/public_html/cp3024/passex/passwd

Require compu3024

By using the htpassswd command we can create a .htpasswd file

" htpasswd -c file-name user-name "

example--> htpasswd -c passwd compu3024

where file-name refers to the file to hold the password

and user-name is the user-name associated with the "realm" make sure password file is world readable
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 07-17-2007, 07:49 AM
Kamalakannan Kamalakannan is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 299
Kamalakannan is on a distinguished road
Default Error document setting in .htaccess file

Are you know what is the use of ErrorDocument setting in .htaccess.

Thanks for Advance.
--kamal.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
windows 2008 server to hide users folders in c:\users\*[/ shaalini Operating Systems 3 06-26-2009 12:47 AM
how can i make a home page which have user name and password? suman Web Design Help 5 12-20-2008 04:21 PM
How to Password-Protect Web Pages: tutorial suman HTML, CSS and Javascript Coding Techniques 0 08-08-2008 02:16 AM
How to attach or mount a file system to the linux root directory.? itbarota Operating Systems 1 07-25-2007 11:43 PM
Htaccess www to non www vadivelanvaidyanathan Search Engine Optimization 0 06-30-2007 12:13 AM


All times are GMT -7. The time now is 03:16 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0