conflict between RewriteRule and AuthType Basic

Discussion in 'Apache' started by alex_funky_dj, Nov 9, 2009.

  1. #1
    I've 2 .htaccess files, one on the root , and here's the content :
    Options +FollowSymLinks
    Options -Indexes
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    
    Code (markup):
    and the other one on "/admin/", and here's the content :
    AuthType Basic
    AuthName "Administrator Control Panel"
    AuthUserFile "./passwd"
    require valid-user
    
    Code (markup):
    when I visit : http://www.domain.com/admin/
    it redirect me to /index.php
    and not showing the authentication window !!

    when I delete 2nd file which in "/admin/" , I can access http://www.domain.com/admin/
    and If I deleted 1st file, the authentication window on http://www.domain.com/admin/ appears !
     
    alex_funky_dj, Nov 9, 2009 IP
  2. alex_funky_dj

    alex_funky_dj Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Ohh, after 2 days of searching, I finally find the solution , just add :
    ErrorDocument 401 default
    Code (markup):
    to either of the 2 .htaccess

    I found the solution here :
    h t t p://www.andrewrollins.com/2008/01/22/wordpress-and-htaccess-password-protected-directories/
     
    alex_funky_dj, Nov 9, 2009 IP