Password-Protect a Directory with .htaccess
-
I researched quite a bit and the best WordPress-aware explanation I found is here. I’ve done all that, but the last step — stopping WP from throwing a Page Not Found error before the server’s password challenge is popped up — isn’t working.
There’s one small difference between the example they give of WP mod_rewrite code and the code I found in my .htaccess file. (It’s the first Rewrite rule in the WP section.) Since I don’t “speak” mod_rewrite, I’m posting below the new .htaccess file I created and asking you smart folks: Can you see why WP is still throwing Page Not Found before the server’s challenge can pop up?
# This file belongs in the root directory of the Web site (/www). # The first block of code is required by the .htaccess file that password protects the /www/archive directory. # It prevents WordPress from throwing a Page Not Found error before the password challenge can pop up. # Our installation of WordPress isn't using Pretty Permalinks (mod_rewrite), # so I don't know why WordPress has written the second block of code below. # (We're using Custom Structure: /index.php/%post_id%/%postname%/ ) # <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} ^/(failed_auth\.html).*$ [NC] RewriteRule . - [L] </IfModule> # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
Thanks for your help!
Viewing 12 replies - 1 through 12 (of 12 total)
Viewing 12 replies - 1 through 12 (of 12 total)
- The topic ‘Password-Protect a Directory with .htaccess’ is closed to new replies.