1

I'm currently in need to have xxx.one.com load the content of yyy.two.com. That means that when someone will enter xxx.one.com they'll actually see the content of yyy.two.com (URL in the browser won't change and will remain xxx.one.com).

The domains are hosted on separate hosting company. yyy.two.com is on a cPanel and xxx.one.com is on an unknown hosting plan, though I can get its details.

yyy.two.com have the same IP of www.two.com and this cannot be changed (as the hosting company told me).

Any ideas on how do I tackle this issue?

Thanks,

Roy

1
  • I take it by "will remain yyy.two.com", you mean "will remain xxx.one.com"?
    – MadHatter
    Mar 11, 2011 at 15:01

3 Answers 3

5

Can you change the DNS record for xxx.one.com be a CNAME to yyy.two.com? You'll also need to configure the web server of yyy.two.com to treat xxx.one.com as a alias (ServerAlias in Apache speak)

4
  • I can create CNAME, yea. But are you sure that yyy.two.com to treat xxx.one.com as an alias and not the other way around?
    – Roy Peleg
    Mar 11, 2011 at 16:25
  • 1
    I agree with the CNAME or Host suggestion. Just send the original request to the correct host up front by using DNS. By far the easiest. Otherwise you'll need to proxy it, which is possible but requires more than a shared account through a hosting company. Mar 11, 2011 at 21:19
  • Do I need either sub domains to have a dedicated IP, separate from the root domain in order to implement this?
    – Roy Peleg
    Mar 11, 2011 at 22:54
  • No, they can be on an IP that is also used for other virtual hosts. Mar 13, 2011 at 15:10
1

How about an old school iframe?

Your browser does not support iframes.

1
  • Not good for other technical reasons.
    – Roy Peleg
    Mar 11, 2011 at 16:26
1

I suggest to use proxypass and proxyreverse.

Reverse Proxy example:
ProxyPass /foo http://foo.example.com/bar
ProxyPassReverse /foo http://foo.example.com/bar

More at: http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

Details:

If you are using apache you can add a virtual host for xxx.one.com. In that one adding the ProxyPass example as above will make the url at http://xxx.one.com/foo to load the content from foo.example.com/bar.

This example is useful whem you don't want to expose that site directly on the internet or when you are too lazy to modify the vpn for a single website (example can continue).

In a web hosting environment this permited only if you have a VPS machine or if you have acceess to the apache's config file: http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass

Context: server config, virtual host, directory

Let me know if more details are needed.

3
  • I didn't understand your example. Can you elaborate
    – Roy Peleg
    Mar 11, 2011 at 16:27
  • Edited, check now.
    – Paul
    Mar 11, 2011 at 18:00
  • Much better, thanks. Though it might be a good solution in some cases often the site loading the content will be on a shared hosting package, thus this might not be always applicable.
    – Roy Peleg
    Mar 11, 2011 at 22:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .