https

Redirecting HTTP to HTTPS Using .htaccess File

Redirecting htt to https using .htaccess file, but make sure your site installs an SSL certificate, you can also see How to install an SSL Certificate

Editing .htaccess in cPanel

  1. Login to cPanel
  2. Files > File Manager > Document Root for:
  3. Now select the domain name you want to access
  4. Check “Show Hidden Files (dotfiles)” See below Image
March 23, 2024
  1. After a new tab or window opens, look for the .htaccess file.
  2. Right click on the .htaccess file and click on “Code Edit” on the menu.
  3. A dialogue box may pop up asking about encoding. Click the “Edit” button to continue.
  4. Edit the file
RewriteEngine On

### WWW & HTTPS

# ensure www.
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# ensure https
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  1. “Save Changes”.
  2. Test your website to make sure it is done correctly.
Like this article? Spread the word
Team sharabindu

Writted by

Sharabindu Bakshi

Sharabindu is not just a tech whiz. He is an excellent communicator and collaborator. Working closely with clients to understand their goals and preferences. Whether you are a small business owner looking to establish your online presence or a seasoned entrepreneur looking to take your website to the next level, Sharabindu will work tirelessly to exceed your expectations.

You may also Like

How to disable URL from WordPress comments text

WordPress comment forms are an essential aspect of engagement for any website utilizing this versatile content management system (CMS). While

Continue reading →

How to Add Barcode to WooCommerce Site

Barcodes are an important element on your WooCommerce site. Adding a barcode can be helpful for inventory management, product identification,

Continue reading →

How To Add QR Code In WooCommerce Order email

QR codes are everywhere now. QR code in WooCommerce is an essential element of order emails. Adding a QR code

Continue reading →

Boosting the efficiency of WooCommerce with barcodes

How implementing barcode technology can streamline your WooCommerce site operations and increase efficiency Table of Content Optimizing Inventory Control Enhancing

Continue reading →