Step-by-Step Guide to HTTPS Implementation
Set up redirects, enable HSTS, and avoid mixed-content to fully secure your site.
Key Steps
- Install certificate (Apache or Nginx)
- Force HTTPS with 301 redirects
- Enable HSTS
- Fix mixed content
- Update canonical URLs and sitemaps
Apache Redirect
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Nginx Redirect
server {
listen 80;
server_name example.com www.example.com;
return 301 https://$host$request_uri;
}