Redirect HTTP to HTTPS in .htaccess

Adds .htaccess rules to permanently redirect all HTTP requests to HTTPS. Uses mod_rewrite with HTTPS environment variable check - compatible with reverse proxies that set X-Forwarded-Proto.

When you need this: After enabling SSL to enforce HTTPS-only access across all pages.

Command


        
2 views 0 copies
Log in to rate
Log in to save

Free account — save snippets into your own collections.