Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've got two sites which are hosted on different servers. 1) domain-one.com 2) domain-two.net

I installed a WordPress blog on site one at domain-one.com/blog/. I want visitors of domain-two.net to be able to access the blog installed on site one via domain-two.net/blog/.

I have a WordPress plugin called "Domain Theme" that changes the look of the blog depending on the domain the visitor is accessing it from. This plugin determines where the visitor is coming from via the $_SERVER['SERVER_NAME'] variable.

I have an .htaccess file in domain-two.net/blog/ redirecting requests to domain-one.com/blog/. Going to domain-two.net/blog/dog.php actually shows what's at domain-one.com/blog/dog.php.

Unfortunately, the Domain Theme plugin for WordPress can't tell when it's being accessed from domain-two.net because after the rewrite in .htaccess, the value of $_SERVER['SERVER_NAME'] is domain-one.com (not domain-two.net). Because of this, I see the same theme when I access the blog from either domain.

Is there a way to redirect requests from domain-two.net that lets the plugin know where they're really coming from?

share|improve this question
    
So, why did this question get migrated to WPSE? It's more of a server/htaccess/redirect question. –  Chip Bennett Aug 13 '11 at 19:08
    
Yes and no. It's a question on redirecting, but does involve some deeper knowledge of WP (specifically the Domain Theme plugin) to get it working. –  EAMann Nov 13 '11 at 17:22
add comment

migrated from webmasters.stackexchange.com Jul 8 '11 at 19:50

This question came from our site for pro webmasters.

1 Answer

I can think of 2 approaches to try:

  1. You can use a referrer variable within the link such as: domain-two.net/blog/?ref=blog2

The receiving blog should watch out for the content of the ref variable.

  1. You can just copy domain-one.com into domain-two.net/blog, then access the database of domain-one.com remotely via wp-config.php
share|improve this answer
    
The first approach is actually the better one because you will still be using just one site. It's pretty trivial to make the plugin look for the referrer variable as well. –  EAMann Nov 13 '11 at 17:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.