More

    How to redirect HTTP to HTTPs in .htaccess

    Today’s standard is to have an https certificate. Google will love you if your sites are secured. So https is not standard, it’s must-have! Easy way to make your website secured is making a redirect from HTTP to HTTPS in the .htaccess file.

    33.2% of Alexa top 1,000,000 websites use HTTPS as default, 57.1% of the Internet’s 137,971 most popular websites have a secure implementation of HTTPS, and 70% of page loads (measured by Firefox Telemetry) use HTTPS. Statistics are from April 2018.

    Source: Wikipedia

    Redirect HTTP to HTTPs in .htaccess

    Using this code to successfully redirect your domain from http to https is the easiest way:

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    

    Using the 301 'permanently moved' redirect will help transfer your SEO rankings. To redirect using the 302 'temporarily moved' change [R=302,L]

    Redirect HTTP to HTTPs with a plugin in WordPress

    If you are not familiar with .htaccess, you can use a plugin Really Simple SSL. The plugin has no complicated settings, but for this problem it’s overkill.

    Recent Articles

    How to remove category & tag base from WordPress URL

    Would you like to remove the category & tag base from WordPress URL? Do you need custom URL's? It's a super simple!...

    How to Disable Right Click on WordPress

    Are you worried about having your images stolen from your WordPress website? Then you need to know how to disable right click on...

    How to redirect HTTP to HTTPs in .htaccess

    Today's standard is to have an https certificate. Google will love you if your sites are secured. So https is not standard,...

    How to fix TypeError: $ is not a function in WordPress

    We can guess. You purchased a theme or plugin and a console shown a message "TypeError: $ is not a function"? Ok,...

    How to fix Unknown collation: ‘utf8mb4_unicode_520_ci’

    Unknown collation is probably caused because your local and live server are running different versions of MySQL. This problem mostly comes when...

    Related Stories

    Leave A Reply

    Please enter your comment!
    Please enter your name here

    Stay on op - Get the daily news in your inbox