Force redirect to https for Nginx and Apache
A simple way to set redirect to https for any site on your nginx/apache configuration. ApacheRewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R=301,L]Nginxserver { listen 80; server_name ${DOMAIN}; return 301 https://$server_name$request_uri; }…