How do I redirect/enable my Website or WordPress's website from HTTP to HTTPS by default

How do I redirect or enable my WordPress's website or my current website from HTTP to HTTPS by default

Why should I use https?

We encourage our clients to use https for their website, this is our default website protocol. We provide free SSL certificate for our clients that purchase any of our web/email hosting plan. SSL or HTTPS protects your website and encrypts your data in transit. If you haven't switch your website to https please do. HTTP is insecure and can be subject to cyber attacks, and attackers can compromise your website and access to sensitive information

SSL (Secure Sockets Layer) is the standard security protocol for an encrypted link between a web server and the browser. SSL encrypt our data and provide safe browsing on the internet, it provides data encryption in transit. For more information about SSL please click here

 

Why do you need SSL? The answer is simple; to protect your information, especially when you are transmitting sensitive information online such as payment information, credit card information, your contact information, and other important data. 

Configure your WordPress's URL to use HTTPS instead of HTTP

  • Note: By default, your website either via WordPress, site builder or others will response via HTTP, instead of https, but both HTTP and HTTPS will work except by default most website response via HTTP first
  • To have your WordPress's website use https, please make sure you specify to use https during installation
  • Example: https://domain.com
  •  If you install the Wordpress website's URL under HTTP, this can be changed by login to your WordPress account and navigate to Settings > General Settings
  • Change both WordPress Address(URL) from HTTP to https, and Site Address(URL) from HTTP to HTTPS
  • Click Save 

How to enable and enforce the WordPress admin over SSL?

  • This will make sure your admin page is https not http
  • To quickly enable and enforce WordPress administration over SSL, the constant FORCE_SSL_ADMIN should be set to true in your site’s wp-config.php file to force all logins and all admin sessions to occur over SSL.
  • Update your wp-config.php file and change
    • define('FORCE_SSL_ADMIN', true);
  • The constant FORCE_SSL_ADMIN can be set to true to force all logins and all admin sessions to happen over SSL.
  •  

How do I redirect my website from http to https?

Another way to change your website HTTP to HTTPS is to do redirect

  1. Login to your Cpanel account and under "FILES" click on "File Manager", click on the "public_html" folder in your root or top directory
  2. To see the hidden files, from the top right side, click on "Settings", then  "Preferences",  select "Show Hidden Files (dotfiles)
  3. Click save and you should see the hidden files, including the one we about to edit which is ".htaccess"
  4. Note: Backup your ".htaccess" file before you edit the file, this is very important should you need to rollback your changes
  5. From the lists of files in "public_html" folder click on ".htaccess" and click "Edit" from the top menu
  6. Once you click the Edit from the top menu, you will see a message, just click on "Edit" button below and that should allow you to edit the hidden file .htaccess
  7. In the edit window, add the following lines to the bottom line:

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteCond %{HTTPS} off

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

</IfModule> 

Note: If you already have the "<IfModule mod_rewrite.c>" block, just add the following to the bottom right before "/IfModule>

RewriteCond %{HTTPS} off

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

 

  • wordpress, redirect, http, https
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Installing and setting up WordPress

Accessing Your Wordpress on AkolagTech Platform Thanks for signing up for our hosting plan, one...

Installing and setting up WordPress

Accessing Your Wordpress on AkolagTech Platform Thanks for signing up for our hosting plan, one...

Accessing your WordPress

Accessing Your Wordpress on AkolagTech Platform Thanks for signing up for our hosting plan, one...

Accessing your WordPress

Accessing Your Wordpress on AkolagTech Platform Thanks for signing up for our hosting plan, one...

How do I move my WordPress from a subdirectory to the root or top directory?

How do I move my WordPress from a subdirectory to the root or top directory? We often get this...