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

Here's the situation:

I recently re-structured my website at I still have the old legacy website at (hosted on the same server). Is it possible to use an Apache htaccess rewrite rule to make my legacy content appear available under a subdirectory on my new site?

In other words: I want to be able to go to and see the content which is actually located at

Have been searching around without much success. I thought something like the following might do the trick, but maybe I'm way off?

RewriteCond %{HTTP_HOST} ^$
RewriteRule ^/legacy/?$ [R=301,L]
share|improve this question
Either do redirect to the legacy site (users will see different URL in the address bar of the browser) or setup a reversed proxy (it'll look like the content is on the same site, but all traffic will go thru the main server) – Kamil Šrot Nov 20 '12 at 8:50
Is it necessary to use a reverse proxy even if the legacy site is hosted on the same server? No way to simply do it through htaccess? The main issue here is SEO and link juice: I want all the legacy content to be served from the same domain as the main site (so I don't want to redirect to legacy.pixelscrapper subdomain)... – Jordan Magnuson Nov 20 '12 at 9:05
Theoretically it's possible, but if it's a hosting server, it'll be not supported / isolation of accounts is the most important part of shared hosting security - anyway, it's not the biggest problem, the same can be achieved by the proxy request using mod_rewrite and P switch to the RewriteRule / the problem is how to fix URLs inside the content of your legacy site, to point to the and this w/o mod_proxy_html... what about to talk with your hoster? Or can you modify the legacy site so, it'll produce the correct URLs? – Kamil Šrot Nov 20 '12 at 12:28
Thanks for your help Kamil... it turns out that setting up a reverse proxy with apache mod_proxy is easier than I expected, so that's what I've done, and it's working like a charm. Thanks for pointing me in the right direction! – Jordan Magnuson Nov 20 '12 at 12:44
No problem. Cheers! :-) – Kamil Šrot Nov 20 '12 at 12:50
up vote 0 down vote accepted

It turns out that the way to achieve what I was after is to set up a reverse proxy using Apache's mod_proxy... which is actually pretty easy to do. There's a good tutorial on this at

share|improve this answer

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.