DNS / webhosting question
December 16, 2015 10:48 AM   Subscribe

I have two sites. http://a.com/ and http://b.com/. Is it possible for me, without breaking a.com functionality, to have http://b.com/ display content that I have on http://a.com/foobar?

I have access to manage the DNS for both a.com and b.com. I'm not interested in doing a redirect, I'd like the url in the browser to show http://b.com/ but have the content come from http://a.com/foobar. Is this possible? I'm not a very advanced DNS person. Thank you!
posted by rachelpapers to Computers & Internet (9 answers total) 1 user marked this as a favorite
 
You would do this by embedding the content from the a.com URL in the b.com content.

There are plugins to do this seamlessly in Wordpress. What CMS are you using on b.com?
posted by tomierna at 10:50 AM on December 16, 2015


Response by poster: No cms on b.com. Drupal on a.com. I'm hoping to do this purely with DNS.
posted by rachelpapers at 10:53 AM on December 16, 2015


Best answer: You can't do it purely with DNS, although some DNS providers offer a solution that essentially uses one of their own servers to frame content from yours. For example, NameCheap (the name registrar I use) also provides DNS and offers "URL redirect" that does this. It looks like a pure DNS feature since they offer it through their DNS management panel, but it actually requires an HTTP server to be in on the act as well; they just set that up transparently for you.
posted by kindall at 10:56 AM on December 16, 2015 [1 favorite]


Response by poster: Ok. Thank you all. Basically I want to try to do this while expending the least amount of work on a client's behalf. I think I may just do a redirect so that a visit to b.com ends up with the browser at a.com/foobar. I appreciate your help.
posted by rachelpapers at 11:12 AM on December 16, 2015


The term you want to look up is "server side include".
posted by Chocolate Pickle at 11:39 AM on December 16, 2015


If you have control over the web server setup, mod_proxy on b.com can easily pass the a.com/foo stuff.

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

You are interested in the reverse proxy stuff.
posted by advicepig at 11:42 AM on December 16, 2015


Agreed that you're looking for a reverse proxy. A number of development frameworks now use this pattern for aggregating a number of applications into a single site. You could have web applications running on different ports on the same machine or on different systems and the proxy handles SSL and redirection.
posted by mikeh at 11:57 AM on December 16, 2015


Set up CNAME in your zone file for b.com to point to a.com/foobar
posted by GiveUpNed at 9:00 PM on December 16, 2015


By the way, if you do choose to go the reverse proxy option (and therefore serve identical content on both b.com and a.com/foobar) then you may suffer a search engine ranking penalty. (I've never done exactly this scenario, but I have accidentally served the same content off a.com and www.a.com -- without a redirect -- and there's definitely a penalty for that.)

If you use a redirect, you won't have that problem, so that's what I'd recommend.

CNAMEs don't apply in this case as they work at the domain name level ("a.com"), rather than with URIs ("/foobar").
posted by snap, crackle and pop at 11:53 PM on December 16, 2015


« Older "Don't come in high on your first day!" yes I...   |   Accounts of people who have come back from... Newer »
This thread is closed to new comments.