Jump to content

Is this possible??


kkwong00

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/55386-is-this-possible/
Share on other sites

"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

Link to comment
https://forums.phpfreaks.com/topic/55386-is-this-possible/#findComment-274655
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/55386-is-this-possible/#findComment-276692
Share on other sites

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>

Link to comment
https://forums.phpfreaks.com/topic/55386-is-this-possible/#findComment-278265
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/55386-is-this-possible/#findComment-278330
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.