http https code example
Example 1: https
HTTPS (Hypertext Transfer Protocol Secure) is a secure version of the HTTP
protocol that uses the SSL/TLS protocol for encryption and authentication.
HTTPS is specified by RFC 2818 (May 2000) and
uses port 443 by default instead of HTTP’s port 80.
The HTTPS protocol makes it possible for website users to transmit sensitive data such as credit card numbers, banking information, and login credentials securely over the internet. For this reason, HTTPS is especially important for securing online activities such as shopping, banking, and remote work.
HTTPS is now the standard protocol for all websites,
whether or not they exchange sensitive data with users.
Example 2: HTTP to HTTPS
# .htaccess
# WordPress Website von http zu https umziehen
# Move WordPress website from http to https
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>