Support » Plugin: Really Simple SSL » htaccess redirect stopped working

  • Resolved zimbo000

    (@zimbo000)


    I haven’t changed settings on the plugin for months, simply updated it on new versions.

    Tools > Site Health reported today that “301 .htaccess redirect is not enabled”. When I checked in SSL Settings, both WordPress and .htaccess redirects were ON. No idea how. It used to be only htaccess.

    This is the code in my .htaccess file, which used to work:

    # BEGIN rlrssslReallySimpleSSL
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTPS} !=on [NC]
    RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/ [NC]
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    </IfModule>
    # END rlrssslReallySimpleSSL

    I reloaded the htaccess file with the above SSL code. Then turned off WordPress, set ‘Enable 301 .htaccess redirect’ and ‘Stop editing the .htaccess file’ to ON.

    Then I save settings, and I now get this message at the top of the page:

    You do not have a 301 redirect to HTTPS active in the settings. For SEO purposes it is advised to use 301 redirects. You can enable a 301 redirect in the settings. View settings page

    And under Enable 301… 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[3.2.6]
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP:X-Forwarded-Proto} !https
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
    </IfModule>
    # END rlrssslReallySimpleSSL
    If the setting ‘do not edit htaccess’ is enabled, you can’t change this setting.

    I also now get this message in Configuration, along with a red “1” by Settings > SSL , which has never appeared until just now:

    WordPress 301 redirect enabled. We recommend to enable the 301 .htaccess redirect option on your specific setup. Enable or dismiss

    Any idea what’s gone wrong and how to fix? I’ve turned WordPress redirect back on (and htaccess off) so everything continues to work properly.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author RogierLankhorst

    (@rogierlankhorst)

    Hi @zimbo000,

    The .htaccess redirect in the .htaccess file will still work. I would recommend to just enable the .htaccess redirect again.

    Possibly the notification in the site health was a false positive, we’ll look into that.

    You can enable both WordPress and .htaccess redirect at the same time, without issues.

    zimbo000

    (@zimbo000)

    It seems to be working again now. I suspect the issue was the timing in setting of the ‘Stop editing the .htaccess file’ flag.

    I noted the Last Modified time of .htaccess had changed on the server after I’d set the flags on, and when checked, the SSL section was missing from the file. So the plugin must write to .htaccess when those flags are set, necessitating the file be re-loaded.

    So the sequence needs to be set ‘Enable 301 .htaccess redirect’ and ‘Stop editing the .htaccess file’ to ON. Then re-load the .htaccess file with the SSL section.

    Site Health no longer has the message either.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.