Redirecting to different server but same domain.
I have 2 servers on different hosts. One has domain.com and the other domain.org. domain.org has more resources. Now i want to create a sub domain on the first one (sub.domain.com) and redirect to (sub.domain.org) whiles maintaining the .com in the urls.
Thanks.
It depends on what’s your hosting running on (Apache, nginx etc…).
In nginx you can use proxy_pass to redirect request to another host while still preserving url:
location / {
proxy_pass http://domain.org:80;
proxy_set_header X-Real-IP $remote_addr;
}
Take look at nginx docs for more info: http://wiki.nginx.org/HttpProxyModule
Or this discussion can be helpful: http://www.webmasterworld.com/apache/4464836.htm
It may be possible to also do this by manipulating DNS records so sub.domain.com is resolved to host where subd.domain.org is running (but you need to handle HTTP Host header in webserver)