kkwong00 Posted June 13, 2007 Share Posted June 13, 2007 I am helping a non-profit organization to maintain two websites www.abc.org www.xyz.org The two websites were built by different people and they are hosted in two different servers. Recently my director wants to combine the two websites into one and put the xyz website under the abc website, so the xyz is no longer a separate site by itself, but it is kind of a sub-site under abc, like www.abc.org/xyz To reduce the complexity for being physically combine the two websites into a single one, I believe somehow there should be a way to link them up www.abc.org/xyz -> www.xyz.org I have tried different ways of redirection, but it seems they all change the url display on the browser to www.xyz.org after redirect. My director is really keen to not have the www.xyz.org any more as xyz is now something belongs to abc Is it possible to get www.abc.org/xyz link to www.xyz.org at the same time the url still reads www.abc.org/xyz? Quote Link to comment Share on other sites More sharing options...
obsidian Posted June 13, 2007 Share Posted June 13, 2007 Out of curiosity, would he be opposed to setting up a sub-domain instead? To me, the most feasible thing would be to set up http://xyz.abc.org as your sub-domain. Quote Link to comment Share on other sites More sharing options...
steviewdr Posted June 14, 2007 Share Posted June 14, 2007 "Is it possible to get www.abc.org/xyz link to www.xyz.org at the same time the url still reads www.abc.org/xyz?" Yes - depending on whether relative or static links are used in the xyz website. Is the xyz website moved onto the abc server?? A proxy rewrite will get www.abc.org/xyz to link to www.xyz.org and have the url read www.abc.org/xyz If you enable the mod_proxy module with apache, and put the following line on your www.abc.org server, in a htaccess file located at: /var/www/xyz RewriteRule ^/(.*) http://www.xyz.org/$1 [P] The [P] is to use mod_proxy. As I said at the start - this depends on whether the website has relative or absolute links. e.g. <a href="http://www.xyz"> = absolute. <a href="page.html"> = relative -steve Quote Link to comment Share on other sites More sharing options...
kkwong00 Posted June 18, 2007 Author Share Posted June 18, 2007 So both websites have to be in the same server? Quote Link to comment Share on other sites More sharing options...
steviewdr Posted June 18, 2007 Share Posted June 18, 2007 Nope - with mod_proxy - they can be on different servers. All that will happen is that www.abc.org/xyz (with a simple htaccess file with the previous code) will "proxy" calls to www.xyz.com on the fly in the background. It will still resolve and call www.xyz.com under the covers, but it will still show www.abc.org/xyz/websiteon_xyz.html in the URL bar. -steve Quote Link to comment Share on other sites More sharing options...
kkwong00 Posted June 20, 2007 Author Share Posted June 20, 2007 That sounds cool, exactly what I am after Do I need to enable the mod_proxy on both server? I have tried the stuffs below on both server, but it doesn't seem working <IfModule mod_proxy.c> ProxyRequests On <Proxy *> Order deny,allow Deny from none Allow from all </Proxy> ProxyVia On </IfModule> Quote Link to comment Share on other sites More sharing options...
steviewdr Posted June 20, 2007 Share Posted June 20, 2007 You need to enable mod_proxy only on 1 server - the one were you are browsing www.abc.org/xyz because you want www.abc.org to PROXY requests to www.xyz.org As it is not working, I suggest you do not have mod_proxy or proxy_html modules enabled. Keep googling, and trying different ways. -steve Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.