Redirect rules

Redirect to https not working

After you enable Really Simple SSL, by default a PHP redirect is activated, which is called wp 301 redirect in the plugin. If you notice your site can still be reached over http://, possibly the redirect does not work because the site is cached.

If you’re using Apache or litespeed, the best redirect method is the .htaccess redirect. As not all servers use Apache/litespeed, and not all servers support the detected .htaccess redirect rules, this is not enabled by default.

If you enable the .htaccess redirect in the settings (only apache) a redirect is activated that is executed even before the site is loaded, which is faster then the wp redirect.

Please make sure you know how to remove the .htaccess redirect if necessary. In a few cases the detected redirect does not work, resulting in a loop. You should then remove the .htaccess redirect using FTP.

On NGINX, if you want to do a redirect before WordPress is loaded like the .htaccess, you can add a redirect in the nginx.conf

Related Articles

6 Comments

  • Jessica Ong

    Hi Rogier,
    I am using Apache, and I have enabled 301 .htaccess redirect.
    It states this:
    The .htaccess redirect rules that were selected by this plugin failed in the test. The following redirect rules were tested:

    # BEGIN rlrssslReallySimpleSSL rsssl_version[2.5.22]

    RewriteEngine on
    RewriteCond %{HTTPS} !=on [NC]
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

    # END rlrssslReallySimpleSSL

    What does it mean?
    p/s: I am not IT background

    • Mark Wolters

      Hi Jessica,

      it could be your .htaccess file is not writeable. You can check the file permissions on the .htaccess file using an FTP client or add the rules manually. You can paste the entire block from # Begin.. to # END.. at the top of your .htaccess file.

      Mark

  • Simon

    Hi Mark

    I’m getting exactly the same error as Jessica and have pasted the entire block into .htaccess as you suggested. Debugging log states as follows:

    Options:
    * htaccess redirect
    * WordPress redirect
    * Mixed content fixer
    SERVER: apache
    SSL is enabled for this site
    ** Detecting configuration **
    plugin version: 2.5.22
    Already on SSL, start detecting configuration
    ssl type: LOADBALANCER
    ** Configuring SSL **
    testing htaccess rules…
    test page url, enter in browser to check manually: https://varc.org.uk/wp-content/plugins/really-simple-ssl/testssl/loadbalancer/ssl-test-page.html
    htaccess rules test failed with error: SSL: no alternative certificate subject name matches target host name ‘varc.org.uk’
    checking if .htaccess can or should be edited…
    .htaccess does not contain default Really Simple SSL redirect
    retrieving redirect rules
    converting siteurl and homeurl to https

    Any pointers would be warmly welcomed.

    Thanks

    Simon

  • Goran

    Hi, I installed and activated plugin but then I got err_too_many_redirects and when I tested home page link it showed 19 301 redirects. When I turn back to http everything is ok. Any suggeston?
    Thanks.

Leave a Comment