Currently I have my companies blog on the same server as our main web app - as in example.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 example.com/blog or blog.example.com?
Issue 301 HTTP redirects from website.com/blog to blog.website.com
The specifics depend on the server.
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 (update 2016: link leading nowhere) 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With