-1

I have a url xyz.example.com for which contents were moved to abc.example.com.

I know this can be redirected using mod_rewrite and had moved too, but when accessing xyz.example.com, in user's browser too, url changes to abc.example.com which is not acceptable.

I want that in user's browser, only xyz.example.com and not the abc.example.com to be visible. Please suggest appropriate configuration which I can use in my conf file,

Thanks in advance.

Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47
Naresh
  • 3
  • 1
  • 1
    This is simply not possible with mod_rewrite. You are mis-understanding what mod_rewrite does. I suggest re-asking your question without assuming that you know what technology to use to solve the problem. – Fred the Magic Wonder Dog Mar 21 '14 at 18:34

1 Answers1

1

A Rewrite Rule with a domain name in the target is a Redirect.

A redirect tells the browser to make a new request for a new URL, so Redirect changes the URL in the browser.

To achieve what you want you should use a mechanism where xyz.example.com will act as a frontend server, and abc.example.com as a backend server.

Then, the front end server will forward incoming HTTP request to its backend server, and will send the response back to the client, all this totally transparent for the end-user.

This mechanism is handled by an Apache module called mod_proxy.

You will have to enable this module in your Apache configuration and then setup your Virtual Host with some directives like this :

ProxyPass / http://abc.domain.com/
ProxyPassReverse / http://abc.domain.com/
krisFR
  • 12,830
  • 3
  • 31
  • 40