Apache htaccess password protect and mod_rewrite

Eric Cope eric.cope at gmail.com
Mon Oct 14 17:01:45 MST 2013


Hi all,
I have a server with a basic wordpress installation. I am using the
Wordpress generated htaccess mod_rewrite rules for pretty urls. I am also
trying to password protect a single file as well. However, when I have
"require valid-user" I get a 404 error from wordpress (I presume its from
the mod_rewrite). If I remove the require-user, it works fine. I've googled
it several times, each time getting a variant of these rules below, but
none of them working. Any ideas?

Thanks,
Eric

RewriteEngine On
RewriteRule ^index\.php$ - [L]
RewriteCond %(REQUEST_URI) !^/eric.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

<Files eric.html>
AuthUserFile /home/bootcamp/.htpasswds/public_html/eric
AuthType Basic
AuthName "My Secret Page"
require valid-user
errordocument
<Files>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.phxlinux.org/pipermail/plug-discuss/attachments/20131014/6a1cef4f/attachment.html>


More information about the PLUG-discuss mailing list