Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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: ->
but we'd like to retain*.
In other words, we'd want to access every URL of via

share|improve this question
up vote 3 down vote accepted

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 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 config:
RewriteEngine on
RewriteRule /some/url(.*)$1 [P,L]

share|improve this answer

If you're trying to redirect just a subdirectory of the server, you can use mod_rewrite like this:

RewriteCond %{REQUEST_URI} /some/url [NC]
RewriteRule ^(.*)$$1 [R]

If your trying to show the content of the other site without the user seeing the other url, you'll need both mod_rewrite and mod_proxy

RewriteCond %{REQUEST_URI} /some/url [NC]
RewriteRule ^(.*)$$1 [P]

Other configuration steps may be necessary for mod_proxy, depending on your environment.

Apache's Advanced mod_rewrite Guide may be of benefit.

share|improve this answer

I'd just throw in a file that simply redirects the user with an HTML meta-refresh, or if you want to redirect the user in the most accepted way possible, throw in a 301 redirect rule in an .htaccess file somewhere on the site.


Redirect 301 /some/url
share|improve this answer
A meta-refresh would affect the page as well; and you'd have to add it to every single page in the whole site for it to work correctly. Adding a redirect in an .htaccess file wouldn't work if there's no default record for – Chris S Jul 14 '10 at 3:12
Hm, good point. I've probably read the question wrong: I see that he wants to redirect EVERY URL from to; however, this could use some clarification. – Christian Paredes Jul 14 '10 at 4:25
Added clarification as per your inputs. :) – pugmarx Jul 14 '10 at 5:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.