Skip to content

Instantly share code, notes, and snippets.

@geoclaps
Created September 19, 2018 14:43
Show Gist options
  • Save geoclaps/c6320e9fe50132052361105b11d4d88e to your computer and use it in GitHub Desktop.
Save geoclaps/c6320e9fe50132052361105b11d4d88e to your computer and use it in GitHub Desktop.
Set Wordpress SSL connection
//in the functions.php of your theme add:
define('FORCE_SSL_ADMIN', true);
//in the .htaccess file of the root directory add:
<IfModule mod_rewrite.c>
RewriteCond %{HTTP_HOST} ^(www\.domeinnaam\.nl|domeinnaam\.nl)$ [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.domeinnaam.nl/$1 [R=301,L]
</IfModule>
//Go to Wordpress admin > settings and set the url's as https or use a search and replace tool to change http:// to https://
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment