Created
September 16, 2022 20:02
-
-
Save loorlab/e006ad476c7be0dbac26a6ad14e140a1 to your computer and use it in GitHub Desktop.
.htaccess https and force non www WordPress
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