Apache redirect by without URL rewriting

apache-2.2mod-rewriterewrite

Is there a way I could achieve redirecting to another site, without losing the original URL?
So, what we'd want to achieve is to be able to access:
somesite.com/some/url -> someothersite.com/some/url
but we'd like to retain somesite.com/*.

In other words, we'd want to access every URL of someothersite.com via somesite.com.

Best Answer

Are you actually looking for a redirect, or to have that other site's content appear under your original URL (more proxying)? I'll assume that the other server is your content and either internal/backend or if public you're aware of the negative SEO implications. If someothersite.com is not your site and content, you probably shouldn't be doing this.

You'll need to have mod_proxy and mod_rewrite running, which is likely uncommenting the lines mentioning it if not already done.

Then in the somesite.com config:
RewriteEngine on
RewriteRule /some/url(.*) http://someothersite.com/some/url$1 [P,L]