Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I know that this question comes up often, I followed many examples and suggestions, but i just cant get it to work. Heres what I need to achieve:

I have two configure two domains to redirect to subdomain of one of them: (and and should all send 301 Moved Permamently header and redirect to

I've set up NamedVirtualHost for as follows:

Redirect 301 ^/

And that seems to work for but does not redirect, whole setup seems to be ignored and files from server's default host configuration setup are served.

As for redirecting from to I created two NamedVirtualHosts, is the actual site with its configuration (ServerName set to and is configured with this:

Redirect 301 ^/

And this configuration also fails.

From what I read about redirecting within Apache Redirect directive should be sufficient to achieve what I need. I could use some mod_rewriting or even use PHP and appropriated headers() to do what I want, but can someone please explain to me what is wrong with my thinking and this configuration.


share|improve this question

1 Answer 1


Redirect permanent /(.*)$1

Incase you don't want to append the request to the domain then you can do

Redirect permanent /(.*)
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.