0

I am currently hosting the contents of a site with ProviderA. I have a domain registered with ProviderB. I want users to access the contents (www.providerA.com/sub/content) by visiting www.providerB.com. A domain forward is easy enough and works as intended, however, unless I embed the site in a frame (which is a big no-no), the actual URL reads www.providerA.com/sub/content despite the user inputting www.providerB.com.

I really need a solution for this. A domain masking without the use of a frame. I'm sure this has been done before. An .htaccess domain rewrite?

Your help would be hugely appreciated! I'm going nuts trying to find a solution.

Justin Ward
  • 825
  • 1
  • 7
  • 14

1 Answers1

0

For Apache

  • Usual way: setup mod_proxy. The apache on providerB becomes a client to providerA's apache. It gets the content and sends it back to the client.
  • But looks like you only have .htaccess. So no proxy, you need full configuration access for that.

So you cannot, see: How to set up proxy in .htaccess

If you have PHP on providerB

Setup a proxy written in PHP. All requests to providerB are intercepted by that PHP proxy. It gets the content from providerA and sends it back. So it does the same thing as the Apache module. However, depending on the quality of the implementation, it might fail on some requests, types, sizes, timeouts, ...

Search for "php proxy" on the web, you will see a couple available on GitHub and others. YMMV as to how difficult it is to setup, and the reliability.

No PHP but some other server side language

Obviously that could be done in another language, I checked PHP because that is what I use the most.

The best solution would be to transfer the content to providerB :-)

Nic3500
  • 8,144
  • 10
  • 29
  • 40
  • Thanks for your help, but I didn't really understand all that. I've never written or edited an Apache config file like an .htaccess. To be honest, I don't know much about DNS and I'm far from a web server IT. I specialize in front-end development and web design. I was hoping there would be a simple solution to this problem, as I'm positive it's been encountered plenty of times before. – Justin Ward Nov 10 '18 at 05:00
  • A proxy receives the request from the browser and instead of answering itself, it sends the same request to another server. When the response comes back, it sends it to the browser. So it's browser <-> proxy <-> server. For you, browser <-> providerB <-> providerA. The proxy can be Apache itself (mod_proxy) or some code you write to do it (PHP here). OR take the files from providerA and put them in the documents directory on providerB. No proxy, no extra configuration, faster too. – Nic3500 Nov 10 '18 at 14:59