One of the most crucial aspects to take into consideration for your online presence is running a secure website. Site security is vital whether you’ve had a website for a while or newly started one, especially for e-commerce companies. Additionally, every website that asks for or saves any kind of user data, even something as essential as login credentials, should offer protection to users.
You’re probably not new to feeling apprehensive while entering a website if you’ve ever done so and seen a warning that says “not secure” in the search box.
The HTTP websites are not secure
URLs for websites that start with HTTP are not secure. This implies that hackers might steal, view, or alter your login information or, worse yet, your sensitive data like credit card numbers. Further down the page, you may find more information regarding how HTTP impacts site rankings.
The HTTPS websites are secure
On the other hand, URLs for websites that begin with HTTPS are secure. This implies that you won’t notice a “not secure” warning when you see a website address that begins with HTTPS, and you won’t have to worry about hackers stealing the personal information you use on the website. Well-known websites like youtube.com and flipkart.com use HTTPS to reassure users that their transactions are secure.
HTTP to HTTPS Redirection with .htaccess file modification can be possible by Cpanel or Filezilla:
By Cpanel
1) Go to Cpanel after logging in with your hosting credentials. File Manager
2) Click on public_html
3) If your .htaccess file does not appear then go to the top right and click on Setting
4) A prompt is appearing then check the option Show Hidden Files (dotfiles) and click on the save button
5) Right-click the .htaccess file that appears and edit it.
6) Add the below code to the .htaccess file
Method 1:
RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
Method 2: If method 1 will not work for you then you can try the below code
RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ HTTPS://yourwebsite.com%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
8) Click on the Save Changes button
By Filezilla
A) Login with Filezilla Credentials then Go to root and download the .htaccess file and add the code that I have used in point number 6 and then upload the file and overwrite it.
The website is secured and redirects to HTTPS
I hope this article helps you! If you need any help with this article contact us here!