• Resolved noyed

    (@noyed)


    Hey, my SSL test page returned the following info:

    #SSL TEST PAGE#
    This page is used purely to test for SSL availability.

    #SERVER-HTTPS-ON# (on)
    #SERVERPORT443#
    #LOADBALANCER#

    #SUCCESSFULLY DETECTED SSL#

    So according to documentation I added to my .htaccess the following code and it works:

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTPS} !=on [NC]
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%/$1 [R=301,L]
    </IfModule>
    
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{SERVER_PORT} !443
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%/$1 [R=301,L]
    </IfModule>
    
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP:X-Forwarded-Proto} !https
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%/$1 [R=301,L]
    </IfModule>

    With these settings the website loads faster than ever on https. However, when I try to enter it via http it simply does not redirect: https://lookforloot.com/

    I’m having the setting for Stop editing the .htaccess file enabled because when I tried first to enable the setting of Enable 301 .htaccess redirect it returned the following error: “The .htaccess redirect rules that were selected by this plugin failed in the test.” and this also slowed the page greatly.

    When this code is active in .htaccess the plugin also returns this error: “The mixed content fixer could not be detected due to a cURL error: cURL error 6: Could not resolve host: lookforloot.com%25”

    Also my hosting provider in Webas has a setting of “Force SSL (https://)” but whether I enable or disable it, the outcome stays the same.

    I would appreciate help on that!

    • This topic was modified 4 years, 10 months ago by noyed.
    • This topic was modified 4 years, 10 months ago by noyed.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mark

    (@markwolters)

    Hi,

    the site does seem to redirect to https:// now. Do you have another redirect option enabled?

    There should only be one .htaccess redirect in your .htaccess file. Multiple redirects might conflict with each other.

    If you use one .htaccess redirect and it doesn’t work, it’s possible that the mod_rewrite.c module is not enabled on your webserver. The .htaccess redirect is wrapped in the <IfModule mod_rewrite.c> tags, if that module isn’t enabled the .htaccess redirect won’t work correctly. Your hosting provider can check if this module is enabled.

    Mark

    Thread Starter noyed

    (@noyed)

    Hey, I uninstalled SSL redirect and added this to .htaccess:

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTPS} !=on [NC]
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%/$1 [R=301,L]
    </IfModule>
    
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{SERVER_PORT} !443
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%/$1 [R=301,L]
    </IfModule>
    
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP:X-Forwarded-Proto} !https
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%/$1 [R=301,L]
    </IfModule>
    
    RewriteEngine on
    RewriteCond %{HTTPS} !=on [NC]
    RewriteRule ^(.*)$ https://gamingmansion.pl/$1 [R=301,L]

    But I don’t know if that’s the proper way of doing it. I uninstalled SSL redirect because it slowed down the page tremendously, most likely of multiple redirects having conflict.

    Plugin Author Mark

    (@markwolters)

    Usually it’s enough to have one redirect active.For example, you could leave the first redirect:

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTPS} !=on [NC]
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%/$1 [R=301,L]
    </IfModule>

    in your .htaccess file while removing the rest. The first one is one of the most common. Does that work? Great, then you can leave it as it. If it doesn’t work you can try a different .htaccess redirect. For example, if your site is behind a load balancer you can use:

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP:X-Forwarded-Proto} !https
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%/$1 [R=301,L]
    </IfModule>

    Also see https://really-simple-ssl.com/knowledge-base/manually-insert-htaccess-redirect-http-to-https/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘SSL Redirect breaks on https://’ is closed to new replies.