DEV Community

David Mutebi
David Mutebi

Posted on

1

The truth about SSL certificates.

What is an SSL certificate?
SSL certificates are what enable websites to move from HTTP to HTTPS which is more secure.
SSL — more commonly called TLS is a protocol for encrypting internet traffic and verifying server identity.

Why does your website need an SSL certificate?
During login, SSL secures the username and password.
You also need SSL to stop your customer’s data from being appropriated by hackers if you running an e-commerce website.

How to add an SSL certificate to your site through the .htaccess file
add the following:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]

To redirect only to a specific domain
For redirecting a specific domain to use HTTPS, add the following:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay