views:

63

answers:

2

Currently I have my companies blog on the same server as our main web app - as in website.com/blog

What would be the easiest way to move the blog to a different server yet still let users either access the blog at website.com/blog or blog.website.com?

+2  A: 

Issue 301 HTTP redirects from website.com/blog to blog.website.com

The specifics depend on the server.

David Dorward
so is it not possible to redirect website.com/blog to the new server?
Anthony
what will the user see in address bar after typing website.com/blog? blog.website.com or website.com/blog?
Marek
@Anthony — that is **how** you redirect to the new server.
David Dorward
@Marek — the former. Having a canonical URI for each resource is best practice.
David Dorward
+1  A: 

The answer that I provide is assuming that you are using Apache as the webserver as this is what I am familiar with. If you are using IIS then you may be able to find a similar solution but I cannot guarantee this.

In the past I have come across similar issues, whereby a client is hosting their main website at www.mydomain.com but their blog is hosted by their marketing guys at blog.mydomain.com. For SEO purposes it ca be beneficial to have the blog appear at www.mydomain.com/blog although this is not physically possible due to the nature of DNS protocols.

The answer is to use an Apache module called mod_proxy which allows you to map the url /blog to a subdomain and this is invisible to the end-user and, more importantly, search engines. CodeHaus have published a good article on Configuring mod_proxy and you may like to have a read.

mod_proxy is quite complex and it can take a while to get the settings correct but it is by far the best solution to the problem that you describe.

Matt