Created
October 17, 2016 21:47
-
-
Save fearlex/9f2c746073a0b299b1ba75bef43ab941 to your computer and use it in GitHub Desktop.
Wordpress Force https and non-www
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{HTTPS} off | |
RewriteRule (.*) https://domain.com%{REQUEST_URI} [L,R=301,NC] | |
RewriteCond %{HTTP_HOST} ^www.domain.com [NC] | |
RewriteRule (.*) https://domain.com%{REQUEST_URI} [L,R=301,NC] | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] | |
</IfModule> | |
# END WordPress |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment