Forum | Really Simple SSL

Which 301 Redirect to use?

Home Forums General issues Which 301 Redirect to use?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #89814
    Sascha
    Guest

    Hello Really Simple SSL Team,

    first of all, thank you for your great work.

    There are two 301 redirects:

    * Enable WordPress 301 redirection to SSL

    and

    * Enable 301 .htaccess redirect

    Should I enable both? (Currently I am enabling both, in all sites, I am using this plugin)
    Is enabling both at the same time a problem?

    Kind Regards
    Sascha

    #89815
    Mark
    Keymaster

    Hi Sascha,

    we recommend to only enable one redirect at a time, however as you have experienced on your sites having two redirects active at the same time generally doesn’t lead to issues. We recommend to enable the .htaccess redirect option whenever possible since it’s the fastest one.

    Mark

    #89867
    Sascha Thattil
    Guest

    Hello Mark,

    thank you for your great reply. Really helpful.

    What about the “Enable JavaScript redirection to SSL” is that also a stand-alone redirect. Or can we also keep it “unchecked” in the box?

    Kind Regards
    Sascha

    #90142
    Mark
    Keymaster

    Hi Sascha,

    you can keep the JavaScript redirect unchecked, it will do exactly the same as the .htaccess redirect: redirect all requests to your site to https://. It’s another method of issuing a redirect.

    Mark

    #90577
    Sascha
    Guest

    Hello Mark,

    thank you for all your answers. I really appreciate this.

    Is there a redirect which redirects to https://www.
    What I have seen is that this code redirects to https:// as well as https://www.
    according to whether http:// or http://www. was entered into the browser bar.

    i.e. http:// redirects to https://
    and http://www. redirects to https://www.

    ——————

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

    ——————

    But I want it to redirect to https:/www. only
    Because that is my favorite domain.

    Could you share the modification to the code, so that it does this?

    Kind Regards
    Sascha

    #90590
    Mark
    Keymaster

    Hi Sascha,

    yes, that is possible. To do this you can add a piece of code to the .htaccess that will redirect all non-www requests to the www domain. This can be done in the following way:

    #redirect non-www to www
    
    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} !^www\.
    
    RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

    What this does is that for all request that don’t have www in them (!^www), redirect to https://www. This code can be added above the current Really Simple SSL redirect rules in the .htaccess file.

    For a more detailed explanation about this see https://really-simple-ssl.com/knowledge-base/avoid-landing-page-redirects/

    Mark

    #331878
    bennet cole
    Guest

    Search Engine Optimization and URL redirection

    Normally, Search engines use the 301 status code to transfer the page rank from the old URL to the new URL. The Javascript redirection return http response status code: 200 OK. So Javascript redirection is not search engine friendly redirection and it is better to use some other redirect methods that return status code: 301 Moved Permanently. For example, If you want to notify the search engines (SEO) about your URL forwarding, you should add the rel=”canonical” meta tag to your website head part because search engines don’t analyze javascript to check the redirection.

    #397397
    Jorge
    Guest

    Hi I hope you can help me, I receive this error:

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

    it Says i have active my ssl but my website still is not secure… what more I need to do?

    Thanks

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Which 301 Redirect to use?’ is closed to new replies.

Subscribe