I have a single wordpress installation but I have multiple domain names pointing to the same host. They are set as parked domains in cpanel. I have set the .htaccess file to redirect the domains to different URLs, and those URLs are set as separate paged in the master wordpress installation. I’d like to have each section (wordpress category) have slightly different content in the header, etc.
Before I installed this theme, it worked fine, but with this theme, all the redirections are replaced with the main domain.
Examples:
Main site: domainname.com
Parked A: domainA.com (same as domainname.com/domainA)
Parked B: domainB.com (same as domainname.com/domainB)
I think I figured it out with cpanel’s redirect options. Still working it out, though, to prevent infinite loops.
Hi witzend
Sorry to hear about the hassle.
Vantage on it’s own doesn’t have any capabilities to create redirects or edit htaccess. Any chance you’re using the plugin WordPress SEO? That has the potential to create redirects.
Let us know if you still need a hand resolving.
I’m afraid I wasn’t clear in my initial description. I’m not trying to get Vantage to actually redirect anything. I’m routing several domain names to one wp installation, and I wanted whatever the originating domain name was to stay in the address bar. I found a thread somewhere that listed a solution that worked for me. Note that this is not a recommended solution as it messes with SEO rankings, etc. In my case, this is a personal site for family and friends and SEO isn’t important to me at all. With that in mind, here’s what I did:
I edited the wordpress wp-config.php file to include the following lines:
define(‘WP_SITEURL’, ‘http://’ . $_SERVER[‘HTTP_HOST’]);
define(‘WP_HOME’, ‘http://’ . $_SERVER[‘HTTP_HOST’]);
Thanks for the feedback, appreciate the share.
Sounds ok. Is everything now working as you’d like it to.
domain name wise, yes. The next item on my agenda is that I’d like to have the header graphic and background tile change based on domain name, but that’s probably a topic for another thread.
Super, glad to hear you got the domain issue resolved.
Switching assets on domain is unfortunately a custom development task outside of our support scope. If this is something you’re keen to dive into yourself you’d need to use a child theme. My guess is that you’d print out a custom body class per domain. The custom body class would allow you to change the background and header graphic using CSS. If you need a hand with this or any other custom development task we recommend: https://codeable.io/.
Actually, if anyone is interested, here’s what I have done:
1. Create a folder for your images. I made a folder in the web root named ‘img’
2. Create background images for each domain named domain1.com.bg.jpg, domain2.com.bg.jpg, etc.
3. Edit header.php (probably should learn how to use a child theme) to include the following where appropriate:
style=”background-image: url()”;
4. Voila! Each site has a different background image based on the domain name.
DISCLAIMER:
I’m no code expert. I just reverse-engineer things until they work. There are probably more efficient and more elegant solutions to this issue, but this works for me… until I notice something broken. =)
Also note that this solution is entirely based on the wordpress ‘hack’ listed above that is not recommended by wo experts.
oops. Forgot to mark the code in the last post. The code in step 3 should read as follows:
Awesome :) Nicely done.
Please find a starter child theme here:
https://siteorigin.com/wp-content/uploads/2015/03/vantage-child-starter.zip
The unzipped child theme should be uploaded to /wp-content/themes/.
You can also install the ZIP directly from Appearance > Themes > Add New > Upload Theme.
Copy the header.php file from your parent theme into your child theme folder. Leaving the original in place.
Activate the child theme.
Activating a child theme will cause menu location settings to reset and Appearance > Customize > Theme Design settings to reset. This is unfortunately normal.
Thanks. I was going to start learning about child themes next. This will be a great starting point.
Super :) Let us know if you need a hand along the way.