Created
September 12, 2017 10:58
-
-
Save Gkiokan/72166fa149f9e19e240eed57be70e119 to your computer and use it in GitHub Desktop.
The WPMS non-www to www but grant access to wp-* problem in htaccess
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
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{HTTP_HOST} ^domain\.com$ | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_URI} !^/wp-admin | |
RewriteCond %{REQUEST_URI} !^/wp-json | |
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L] | |
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC] | |
RewriteRule ^$ http://www.domain.com/$1 [L,R=301] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment