Using htaccess Redirect code and redirecting the site from http to https

Home Forums BulletProof Security Pro Using htaccess Redirect code and redirecting the site from http to https

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #32900
    Jaiji
    Participant

    Hi, I’ve just launched a new version of a site and it has 17×301 redirects (all http) in place, all working fine e.g

    RedirectMatch 301 ^/travel/bus/$ http://www.website.com/about/travel/bus/$1

    I’m wanting to move the new site to https using Let’s Encrypt and I’m not sure whether this code is sufficient or do I need to alter the other 301s? If so, how do I do that (in that they would need to redirect from http/oldURL to https/newURL)?:

    # WP REWRITE LOOP START
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTPS} !=on
    RewriteCond %{SERVER_PORT} ^80
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
    RewriteRule ^index\.php$ - [L]
    #32901
    AITpro Admin
    Keymaster

    Yep, it is best to continue to use the individual RedirectMatch redirect code instead of combining it into the WP Rewrite Loop code and then change your WP Rewrite Loop code to rewrite/redirect from http to https.  You want to copy your individual RedirectMatch redirect code into this BPS Root Custom Code text box:  1. CUSTOM CODE TOP PHP/PHP.INI HANDLER/CACHE CODE instead of where you would normally add redirect code (bottom root Custom Code text box #14).  Important!  Change your destination URL’s from http to https.  See this forum topic for the steps to add your http to https WP Rewrite Loop code:  https://forum.ait-pro.com/forums/topic/wordpress-ssl-htaccess-code-rewrite-ssl-rewritecond-server_port/#post-7233

    #32902
    Jaiji
    Participant

    Thanks for your prompt and comprehensive reply. Your support is excellent.

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