htaccess Force Require SSL

This will force SSL, and require the exact hostname or else it will redirect to the SSL version. Useful in a /wp-admin/.htaccess file.

Replace “yourwebsite.com” with your site name

SSLOptions +StrictRequire
SSLRequireSSL
SSLRequire %{HTTP_HOST} eq "www.yourwebsite.com"
ErrorDocument 403 https://www.yourwebsite.com
Share This Post