www.webdeveloper.com
Results 1 to 4 of 4

Thread: .htaccess question

Hybrid View

  1. #1
    Join Date
    Apr 2005
    Location
    Behind my DiGiCo SD7 Console
    Posts
    900

    .htaccess question

    Hi, I have a directory on my server called support

    In support, there is 3 more directories

    support/helpdesk
    support/faq
    support/ma

    There is a directory called "config" in all of those directories:

    support/helpdesk/config
    support/faq/config
    support/ma/config

    Is there a way to protect all of the "config" directories with 1 username/password file?
    Registered Linux User: #463250
    -----------------
    HELPFUL LINKS
    PHP - http://www.php.net
    Website Color Schemer - http://www.colorschemer.com/online.html

  2. #2
    Join Date
    Mar 2010
    Posts
    672
    Just simply place a .htaccess file in each directory with this in it:

    PHP Code:
    AuthType Basic
    AuthName 
    "Directory Name"
    AuthUserFile "/home/accoutname/.htpasswds/passwd" (or whatever your shared directory would be)
    require 
    valid-user 
    This allows you to have all of the .htaccess's in each directory reference the same single authentication file which contains one username and password.

  3. #3
    Join Date
    Apr 2005
    Location
    Behind my DiGiCo SD7 Console
    Posts
    900
    Thanks!

    Is there a way to protect the .htaccess files to not let anyone have access to them (so no one hacks into the site?)
    Registered Linux User: #463250
    -----------------
    HELPFUL LINKS
    PHP - http://www.php.net
    Website Color Schemer - http://www.colorschemer.com/online.html

  4. #4
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    At least 98% of internet users' DNA is identical to that of chimpanzees

Thread Information

Users Browsing this Thread

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles