• Anasayfa
  • .
  • Blog
  • .
  • How to Redirect HTTPS / SSL with .htaccess file?

How to Redirect HTTPS / SSL with .htaccess file?

How to Redirect HTTPS / SSL with .htaccess file?

What does

SSL (Secure Sockets Layer) do? SSL is a type of digital security technology that allows encrypted communication between a website and a web browser. In other words, HTTPS is the secure extension of HTTP. The purpose of SSL/TLS technology is to securely transfer sensitive information such as personal data, payment or identity card.

You can tell whether a website uses this certificate by the green lock icon next to the URL address in the address bar.

ssl

From http to https to the site with SSL certificate supported by .htaccess file We can do the redirection with the following codes.
You can do this by adding the following codes to the beginning of the .htaccess file.

RewriteEngine On
RewriteCond %{SERVER_PORT} !=443
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [NS,R,L]

After adding, there are some things you need to pay attention to. If there is an image, file or page link with http in your software, you may get an error at the top. Your site may appear as not secure. Please pay attention to your software to avoid these situations.

Türkçe English Deutsch Dansk Español Română