{ "@context": "https://schema.org/", "@type": "HowTo", "name": "How to force SSL with .htaccess", "description": "How to force SSL certificate (HTTPS protocol) with .htaccess in two easy steps", "image": "https://pitdesigns.com/wp-content/uploads/2019/02/force-ssl.jpg", "totalTime": "PT1M", "estimatedCost": { "@type": "MonetaryAmount", "currency": "USD", "value": "0" }, "tool": { "@type": "HowToTool", "name": "Browser or FTP Client" }, "step": [{ "@type": "HowToStep", "text": "Login to your hosting, and in the Root folder, right click > edit the .htaccess file", "image": "https://pitdesigns.com/wp-content/uploads/2019/02/htaccess-in-Root-folder.jpg", "name": ".htaccess in Root folder", "url": "https://pitdesigns.com/how-to-force-ssl-with-htaccess/#Step_One" },{ "@type": "HowToStep", "text": "Add these rules in your website's .htaccess file: RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]", "name": "Add Rules to .htaccess", "url": "https://pitdesigns.com/how-to-force-ssl-with-htaccess/#Step_Two" }] }
PIT Designs Logo

How to force SSL with .htaccess

I'm the owner and founder of PIT Designs. I love creating digital presence and creative digital solutions for our clients.


Posted 7 years ago on February 22nd, 2019. Last modified on July 22nd, 2019

Related To:

Tags: |
How To Create Effective Ads for Home Services Marketing

Advertising for home services, such as lawn care, home cleaning, and garden maintenance, isn’t as simple as tossing up an […]

How applicant tracking systems are revolutionizing remote recruitment

Gone are the days of traditional recruitment. Applicant tracking systems have been revolutionizing how we hire, and their impact is here to stay. But how is the change happening? Tap to learn more about it.

Check out the New AI Features in FlexClip 5.0

In today's digital era, the importance of video content cannot be overstated. Videos have become an integral part of various […]

Effective Cleaning Tips for Maintaining a Clean and Healthy Home

We’ll explore some practical tips and tricks that will help you establish an effective cleaning routine. You might not realize […]

The Art of Visual Storytelling

How to use visual elements to tell a story Let's start with an interesting fact that will amaze you. Do […]

The Ultimate Guide to Choosing a Great Domain Name for Your Business

Choosing the right domain name for your business is a critical step in building a strong online presence. Your domain […]

6 Mistakes to Avoid When Creating a React-Native App

React Native is a leading cross-platform app development framework that has more than one and half thousand active contributors. The […]

Will Elon Musk Turn Twitter into a Super-App?

Elon Musk envisions a future where mobile apps are consolidated into one-stop shops within a single platform. Will he create a "super app" to rule them all in 2023? Learn about the challenges he faces and the potential impact on companies like Twitter and Apple's App Store.

When you have SSL enabled (supported by your host provider) it's a good practice to make sure the actual site is running on SSL Secured connection.

To do so, you can force an HTTPS (secured connection) on your website.

Step One

Login to your hosting, and in the Root folder, right click > edit the .htaccess file

 

Step Two

Add these rules in your website's .htaccess file:

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

The .htaccess file needs to be located inside the site's document root folder. If your website is in a sub folder, then the .htaccess should be placed in the corresponding sub folder.

To create or edit the .htaccess file, you can either access the root folder via FTP, or using with the File Manager available in cPanel.


What's .htaccess file?

Lear more about SSL Certificates

Contact us for SSL Certificates

 

Need further assistance?

Read more about SSL Certificates & Website Security. We offer custom solutions per needs.

menu-circlecross-circle