Force HTTPS in WordPress by adding this to your htaccess-file, before the line “# BEGIN WordPress”.
1 2 3 |
RewriteEngine On RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
Also, add this to your wp-config.php. FORCE_SSL_ADMIN is there to make sure there’s no redirect loop in wp-admin.
1 2 3 4 |
$_SERVER['HTTPS'] = 'on'; define('FORCE_SSL_ADMIN', true); define('WP_SITEURL', 'https://henriksson.me'); // replace with your sitename define('WP_HOME', 'https://henriksson.me'); // replace with your sitename |