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 trying to rewrite the domain then redirect to a new page afterwards.

So,, and end all redirect to the new domain fine.

But I need to go to ?

I've removed the L from the domain rewrite rule to allow it to evaluate the final rewrite rule ... but no joy?

<VirtualHost *:80>

    Options +FollowSymlinks
    RewriteEngine On

    RewriteCond %{HTTP_HOST}    !^newsite\.com [NC]
    RewriteCond %{HTTP_HOST}    !^$
    RewriteRule ^/(.*)$1 [R=301]

# needs to go to ->
    RewriteRule ^(2012)$ [R=301]

If anyone can help it'd be much appreciated.

share|improve this question

Put the 'special' rule first -- and you probably want the RewriteCond for both. Also - do you actually need to account for clients that don't send a Host header?

RewriteCond %{HTTP_HOST} !^newsite\.com$ [NC]
RewriteRule ^/2012$ [R=301,L]

RewriteCond %{HTTP_HOST} !^newsite\.com$ [NC]
RewriteRule ^/(.*)$$1 [R=301,L]
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.