Last active
August 12, 2020 17:54
-
-
Save petermann/16650dcb6deb667d6f47dda8b1214594 to your computer and use it in GitHub Desktop.
Multiple Domains into Single Instance of WordPress
This file contains hidden or 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
This file contains hidden or 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 NO-WWW Redirection | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] | |
RewriteRule ^(.*)$ http://%1%{REQUEST_URI} [R=301,QSA,NC,L] | |
</IfModule> | |
# END NO-WWW Redirection | |
# BEGIN HTTPS Redirection | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{SERVER_PORT} !^443$ | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
</IfModule> | |
# END HTTPS Redirection |
This file contains hidden or 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
/* | |
* Handle multi domain into single instance of wordpress installation | |
*/ | |
define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST']); | |
define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment