Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running a Wordpress multisite install where the blogs are created in subdirectories - e.g. www.mydomain.com/blog1, www.mydomain.com/blog2

I need to clarify what I think is and isn't possible with domain mapping so that clients can use their own domain (and therefore improve their SEO) for the blog.

What I want in an ideal world is for www.clientdomain.com/blog to serve the respective Wordpress blog (e.g. www.mydomain.com/blog6) BUT as far as the user is concerned, they are looking at www.clientdomain.com/blog.

I know this is possible with subdomain mapping (e.g. I can serve www.mydomain.com/blog6 as blog.clientdomain.com) but is there any solution for making a subdirectory of one domain serve a website on another domain?

I don't think this is possible without using 301 redirects in .htaccess but just need someone to confirm this for me.

In summary, I believe my options are:

  1. User types www.clientdomain.com/blog and browser loads www.mydomain.com/blog6 (address bar also shows www.mydomain.com/blog6) using .htaccess redirect 301.

  2. User types blog.clientdomain.com and browser loads www.mydomain.com/blog6 (address bar remains blog.clientdomain.com) using domain mapping DNS.

For more information, hosting for wordpress multisite and client website is completely different and client website will have a "normal" site plus email in addition to their blog.

Thanks for your help.

share|improve this question
add comment

1 Answer

You need need to add an vserver with the document root set to the root of the blog (say for example /var/www/blog6) and the vserver name to blog.clientdomain.com. That should do what you want.


Edit

What you are really looking for is a reverse proxy. With reverse Proxying you can let the server resolve a path (for example /blog) from another server.

+--------+   Request   +--------------------+   Request    +--------------------+
| Client |-----------> | Server domain1.com |------------->| Server domain2.com |
+--------+    /blog    +--------------------+   /blog6     +--------------------+
share|improve this answer
    
Thanks for the quick reply. I need the client domain URL to be clientdomain.com/blog rather than blog.clientdomain.com. I don't think there's any way to map a subdirectory onto a domain without doing a 301 redirect? –  Mark Tansey Sep 26 '12 at 15:52
    
Sure there is. It's called reverse proxy. Let me revise my post. –  Christopher Perrin Sep 26 '12 at 15:54
    
Now I have added new info –  Christopher Perrin Sep 26 '12 at 16:00
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.