How to Redirect My Website From HTTP to HTTPS

Home » Help » Performance & Security » How to Redirect My Website From HTTP to HTTPS

Redirecting your website from HTTP to HTTPS is important, as it makes your site more secure, reliable, and safe for you, your site visitors, and all the data transmitted via your pages.

Depending on how your website is built, there are two main methods you can use to make the redirection setup:

  1. By using a .htaccess file that gives rules to the server and makes the redirecting from HTTP to HTTPS
  2. By using the settings on your CMS platform, should your website be based on one.

 

N.B: This is a quick guide on redirecting HTTP to HTTPS. If you wish to delve into details, then check out our comprehensive guide on the topic:

How do I Redirect HTTP Traffic to HTTPS

 

Redirect Your Website from HTTP to HTTPS with a .htaccess File

To redirect your website from HTTP to HTTPS with an .htaccess file, you should follow these steps:

  1. Get an SSL certificate. To be able to redirect to HTTPS, you need to get an SSL certificate for your domain name.
  2. Access your website’s File Manager section in the Hosting Control Panel
  3. Within the File Manager section, search for a file named “.htaccess”.
  4. If there is no such file within the website’s directory, create a new file and name it “.htaccess”.
  5. Open the .access file for editing.
  6. Choose one of the following rules to add to your website:Force “www.”: Redirect all HTTP traffic to HTTPS and the “www.” version of your domain:

    RewriteEngine On RewriteBase / RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://www.protected-site.com%{REQUEST_URI} [L,R=301]Force “non-www.”:

    Redirect all HTTP traffic to HTTPS and to the “non-www.” version of your domain name:

    RewriteEngine On RewriteBase / RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://protected-site.com%{REQUEST_URI} [L,R=301]

    Allow both “www.” and “non-www.” on your domain:

    RewriteEngine On RewriteBase / RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]Copy the preferred code to the .htaccess file and save it.

 

Read also: What is an SSL Certificate and Why is it Important to Use One on Your Website

Redirect Your Website from HTTP to HTTPS with a CMS

You can quickly set up your CMS to redirect HTTP to HTTPS. The setup usually involves changing the settings within the given CMS.

 

WordPress

Log in to your WordPress admin dashboard.

Navigate to Settings > General.

Update the WordPress Address (URL) and Site Address (URL) fields to use HTTPS instead of HTTP. Save changes.

Update any hardcoded HTTP links within your content or theme files to HTTPS.

Install and activate a plugin like “Really Simple SSL” or “WP Force SSL” to automatically handle HTTPS redirection and update insecure content.

Verify redirection by accessing your site using HTTP and ensuring that it automatically redirects to HTTPS.

 

Drupal:

Log in to your Drupal admin dashboard.

Navigate to Configuration > System > Trusted Host Settings.

Add your HTTPS domain to the list of trusted hosts.

Install and enable the “Redirect” module if not already installed.

Configure the Redirect module to redirect all HTTP traffic to HTTPS.

Save configuration changes and verify redirection by accessing your site using HTTP.

 

Joomla:

Log in to your Joomla admin dashboard.

Navigate to System > Global Configuration.

Under the Server tab, locate the “Force HTTPS” setting and set it to “Entire Site.”

Save changes and verify redirection by accessing your site using HTTP.

 

Magento:

Log in to your Magento admin dashboard.

Navigate to Stores > Configuration > General > Web.

Update the Base URL settings for both Secure and Unsecure sections to use HTTPS.

Flush Magento cache and verify redirection by accessing your site using HTTP.

 

Other CMS Platforms

For other CMS platforms, check the official documentation or consult the community support forums for guidance on setting up HTTPS redirection. In some cases, you may need to edit configuration files or use plugins/extensions to achieve redirection.

Conclusion

By following these steps, you can set up your website to redirect HTTP traffic to HTTPS, therefore enhancing the security of your website.

Was this post helpful?

i

Relevant tags:

Connect

Latest posts:

How to Add Products to Zen Cart: A Step-By-Step Guide

After you install Zen Cart and log in to the admin panel, you can start adding products to your online store. This guide walks you through the process step by step.   How to Add Products to Zen Cart To add a product to Zen Cart, you need to follow a few simple...

How to Log in to Zen Cart

Once you install Zen Cart, you can log in to the CMS and start working on your project. The login process is simple and is comprised of only a few steps.   How to Log in to Zen Cart There are two ways to log in to Zen Cart: Method 1: Login by following the...

How to Install Zen Cart

You can install Zen Cart with any of the AwardSpace hosting plans—free web hosting, shared hosting, and advanced plans such as Semi-Dedicated Hosting and VPS hosting. Each AwardSpace hosting service is tailored to run Zen Cart flawlessly and smoothly, regardless of...

How to Log in to phpBB

Now that you have installed phpBB, it is time to learn how to log in to the system and start working with it. The process is simple and is comprised of only a few steps.   How to Log in to phpBB There are several ways you can use to log in phpBB. The process...

How to Install phpBB

You can install phpBB on any AwardSpace hosting plan - on the free web hosting, shared hosting, and also on the advanced AwardSpace plans such as Semi-Dedicated Hosting and VPS hosting. Each AwardSpace hosting service is tailored to run phpBB flawlessly and smoothly,...



Create a website for free!


Free forever

Our Support Team is Here to Help

 

If you need any questions answered, don't hesitate and contact us. Click the button below and follow the instructions. You can expect an answer within an hour.

 

Contact AwardSpace

 

iNewest knowledge base articles

How to Add Products to Zen Cart: A Step-By-Step Guide

After you install Zen Cart and log in to the admin panel, you can start adding products to your online store. This guide walks you through the process step by step.   How to Add Products to Zen Cart To add a product to Zen Cart, you need to follow a few simple...

How to Log in to Zen Cart

Once you install Zen Cart, you can log in to the CMS and start working on your project. The login process is simple and is comprised of only a few steps.   How to Log in to Zen Cart There are two ways to log in to Zen Cart: Method 1: Login by following the...

How to Install Zen Cart

You can install Zen Cart with any of the AwardSpace hosting plans—free web hosting, shared hosting, and advanced plans such as Semi-Dedicated Hosting and VPS hosting. Each AwardSpace hosting service is tailored to run Zen Cart flawlessly and smoothly, regardless of...

How to Log in to phpBB

Now that you have installed phpBB, it is time to learn how to log in to the system and start working with it. The process is simple and is comprised of only a few steps.   How to Log in to phpBB There are several ways you can use to log in phpBB. The process...

How to Install phpBB

You can install phpBB on any AwardSpace hosting plan - on the free web hosting, shared hosting, and also on the advanced AwardSpace plans such as Semi-Dedicated Hosting and VPS hosting. Each AwardSpace hosting service is tailored to run phpBB flawlessly and smoothly,...

How to Remove a Product in OpenCart

After installing OpenCart and logging in to the dashboard, you can start adding and removing products immediately. We have already covered how to add products in OpenCart, and in this article, we share simple steps to delete products from your store with only a few...

Even more web tutorials

Check out our web hosting knowledge base and the WordPress tutorials to learn more, and be better prepared for your website creation and maintenance journey.