Force HTTPS for WordPress websites by .htaccess

Category : wordpress

Here is the method to make your wordpress based website to run always on https.

  1.  Login into wp-admin and goto “Settings -> General”. Make sure the URL have https
    https setting
  2. From filemanager, edit your .htaccess and replace the wordpress rules by following code:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]

    # Rewrite HTTP to HTTPS
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://basezap.com/$1 [R=301,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    Note : Replace basezap by your domain name.  Make sure the position of the https Rewrite rule is same as mentioned above.

And it’s done !

Assumption : You already have a Valid SSL certificate for your domain.

No SSL certificate ? Open a ticket at basezap hosting and claim your Free SSL certificate today !

Follow this guide to Force HTTPS on the PHP/HTML Websites using .htaccess