Results 1 to 3 of 3

Thread: htaccess password protect a single file/script

  1. #1
    Registered
    Join Date
    Oct 2002
    Location
    SATX
    Posts
    9
    Rep Power
    0

    htaccess password protect a single file/script

    I'm trying to password protect a single script on my Wordpress site (login.php) to protect from brute force attacks I've been getting. here is the htaccess code I'm using:

    AuthUserFile /path/to/.htpasswd
    AuthName "Private Access"
    AuthType Basic
    <Files wp-login.php>
    Require valid-user
    </Files>

    both the htaccess and htpasswd files are in the site's root directory.

    When I try to load the login page, I keep getting a 500 server error.

    both files have 644 permissions

    Any ideas?

    Thanks

  2. #2
    Thinkin' out loud again Builder's Avatar
    Join Date
    Nov 2002
    Location
    Illinois
    Posts
    2,088
    Rep Power
    19
    Will this help?
    http://www.askapache.com/htaccess/ht...ct_single_file

    Slightly different coding, but if it works....

    Good luck,
    Kevin
    A good friend will come and bail you out of jail...
    but a true friend will be sitting next to you saying,
    "Damn... that was fun!"

  3. #3
    target='_blank' snowmaker's Avatar
    Join Date
    Nov 2002
    Location
    West Virginia
    Posts
    3,443
    Rep Power
    21
    The difference being everything in the <files> tag. I think that might be the difference between 'work' and 'not work' too. I use .htaccess to 'protect' a few directories, I haven't ever tried to pass protect a single file, so I can't say for sure, but..
    -bruce /* somdcomputerguy */
    'If you change the way you look at things, the things you look at change.'

Posting Permissions

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