1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

.htaccess help (not sure if configured correctly after migration)

Discussion in 'Black Hat SEO' started by xplosiv, Mar 18, 2017.

  1. xplosiv

    xplosiv Power Member

    Joined:
    Oct 18, 2014
    Messages:
    523
    Likes Received:
    118
    Hey guys, I just posted a few of the effects of moving to https on an established website here:
    https://www.blackhatworld.com/seo/http-https-findings-about-https-migration-question.924129/

    However, I have noticed something and I'm not exactly sure if I have configured my htaccess correctly.

    The original site was in http://website.com . It is now https://website.com

    However, I do happen to have links from the www.website.com version, but there are 2 redirections to get to the https version, not just 1.

    EG:

    http://www.website.com > https://www.website.com > https://website.com

    Here is my htaccess file, any help on this would be fantastic:

    ___________________________________

    # BEGIN W3TC Page Cache core
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_COOKIE} w3tc_preview [NC]
    RewriteRule .* - [E=W3TC_PREVIEW:_preview]
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} =""
    RewriteCond %{REQUEST_URI} \/$
    RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC]
    RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html" -f
    RewriteRule .* "/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html" [L]
    </IfModule>
    # END W3TC Page Cache core

    # BEGIN rlrssslReallySimpleSSL rsssl_version[2.5.11]
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTPS} !=on [NC]
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    </IfModule>
    # END rlrssslReallySimpleSSL
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress