htaccess redirect to https may cause redirect to 401.shtml when using password protection

When using the .htaccess for password protection in combination with the .htaccess 301 redirect to https in Really Simple SSL, a redirect to might occur.

A simple solution that has been reported to work is to add

ErrorDocument 401 default

To the top of your .htaccess, so the end result looks like this (the error document should come before the password lines):

# Error Document
ErrorDocument 401 default
#password protection
AuthType Basic
AuthUserFile "/path/to/file"
require valid-user
# BEGIN rlrssslReallySimpleSSL rsssl_version[2.5.25]
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%/$1 [R=301,L]
# END rlrssslReallySimpleSSL

Then clear cache and cookies. For more details on this issue, see this forum thread:

Lightweight plugin, Heavyweight Security features. Get Pro and leverage your SSL certificate for WordPress security standards.