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

I recently went live with a new website and one of the departments on campus referred users to a virtual domain.

For example, masked itself as its own website, which was really

What I want to do, is redirect everyone who hits, to go to,

as well as =>

This is on a new box, so it does not have the original configuration.

The site is being run on Apache, using linux (rhel5).

I am unfamiliar with mod_rewrite. I have done 301 redirects, but I am unable to redirect a virtual sub-domain that way.

share|improve this question
up vote 1 down vote accepted

How about not using mod_rewrite and instead using the redirect statement.

#Virtual Host for IA sub web
<VirtualHost *:80>
   ServerAlias <other domain names they want to associate with this directory; ex:>
   Redirect permanent /
share|improve this answer

You'll need a name-based virtualhost set up for

Inside the virtualhost configuration block, the following rule for mod_rewrite should do the trick:

RewriteRule ^/(.*)$1 [R]
share|improve this answer

Here's what I expect would work, in your Apache configuration (/etc/httpd/conf.d or /etc/apache2/conf.d, a file named, for example,

This may need to be adjusted depending on what other Apache configurations you have, of course.

NameVirtualHost *:80
<VirtualHost *:80>
   Redirect permanent /(.*)$1

<VirtualHost *:80>
   #  Your normal website configurations here


share|improve this answer

if you want have a transparent redirection, try this :

rewriteCond %{HTTP_HOST} ^
rewriteRule ^/faculty(.*)$1 [P]

The apache server use proxy module (you need enable proxy module) to make a transparent redirection (no 301 or 302 http code)

share|improve this answer
Note that this is a proxy, so the address bar won't change, it will stay at the original URL. This doesn't seem to be what the original poster was asking. Also, the destination in the proxy should begin with "http://". Just to be clear on the terminology, it's probably better to call this a proxy not a "transparent redirection". – Sean Reifschneider Sep 4 '09 at 5:40

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.