Skip to content

Instantly share code, notes, and snippets.

@wmgodyak
Created May 4, 2018 09:07
Show Gist options
  • Save wmgodyak/b4a11a03c126af9a2088ecd33ab66d2c to your computer and use it in GitHub Desktop.
Save wmgodyak/b4a11a03c126af9a2088ecd33ab66d2c to your computer and use it in GitHub Desktop.
redirect from http to https custom domain in wordpress multisite example
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^publikom\.se$ [OR]
RewriteCond %{HTTP_HOST} ^www\.publikom\.se$
RewriteRule ^/?$ "https\:\/\/publikom\.se\/" [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment