Redirect Loops Redirect rules Warnings & Errormessages

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 https://domain.com/401.shtml might occur.

A simple solution which 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
AuthName "YOUR AUTH NAME"
AuthUserFile "/path/to/file"
require valid-user
# BEGIN rlrssslReallySimpleSSL rsssl_version[2.5.25]
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# END rlrssslReallySimpleSSL

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

https://wordpress.org/support/topic/rsssl-htaccess-code-causes-401-shtml-on-http-to-https-redirect-when-using-auth/#post-10033367

Related Articles

  • Using safe mode

    Migrating to SSL can cause unexpected side effects. When caching is causing redirects, or a plugin redirects back to http, or other such issues, it can be helpfull to activate...
  • Does Really Simple SSL make my site slower?

    When you’ve activated Really Simple SSL on your site, in some cases you might notice your site has become slower. I specifically built this plugin to be fast: most of the...
  • when the built in deactivation does not work, manual uninstalling

    Installing SSL can be tricky. If another plugin redirects to http, or your certificate is not valid,  a redirect loop could occur, resulting in a not accessible back-end. This plugin is...
  • SSL with CloudFlare and Really Simple SSL

    If you are a CloudFlare user, there are a few things to consider when migrating to SSL. If you run into redirect loops when you use CloudFlare, and have activated...

Leave a Comment