Multisite with multiple domains acting as the same blog
-
My client has 1 shop in 2 physical locations & 2 different domains.
In the past with single site setup, I managed to disable the auto-redirect to the blogs default site url, with some basic url sniffing in theme files I could show appropriate logo’s, content, and a canonical header tag on certain pages so that google doesn’t run into duplicate content issues.
This way customers can realise the 2 physical locations (with different names) are the same brand, and my client has 1 central login with 1 database of products.
I’m now moving it to a multi-site setup (for potential separate sub-brands), and cannot for the life of me, manage to disable the redirect to DOMAIN_CURRENT_SITE.
I’ve been toying with plugins like “WordPress MU Domain Mapping” & “Any Hostname” with no luck, I think Any Hostname doesn’t work with multi-site and I’m currently trying again with MU domain mapping. I’ve got “Disable primary domain check. Sites will not redirect to one domain name. May cause duplicate content issues.” checked, and attempted to set up my alternate domain via settings.
My wp-config.php contains:
define('DOMAINMAPPING_ALLOWMULTI', 'yes'); define('WP_ALLOW_MULTISITE', true); define('MULTISITE', true); define('SUBDOMAIN_INSTALL', false); define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST']); define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']); define('DOMAIN_CURRENT_SITE', 'dev.domain.com'); define('NOBLOGREDIRECT', 'dev.domain.com' ); define('PATH_CURRENT_SITE', '/'); define('SITE_ID_CURRENT_SITE', 1); define('BLOG_ID_CURRENT_SITE', 1); define( 'SUNRISE', 'on' );
.htaccess:
# Inserted By Customer Control Panel <IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule> RewriteEngine On RewriteBase / ### WordPress ### RewriteRule ^index\.php$ - [L] # add a trailing slash to /wp-admin RewriteRule ^wp-admin$ wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ^(wp-(content|admin|includes).*) $1 [L] RewriteRule ^(.*\.php)$ $1 [L] RewriteRule . index.php [L]
I’ve set up the alternatedomain.com as a parked domain in cpanel, it’s definitely somewhere in wordpress doing the redirect, I just can’t find where. I’ve also read there could be issues trying too accomplish this on shared hosting, but I’m unsure if this could be it or if there is an alternate/simpler solution…
- The topic ‘Multisite with multiple domains acting as the same blog’ is closed to new replies.