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 would like to use Apache rewrite to do a 301 redirect for all traffic to the new base url. I don't want the path to be the same, I want every request to be redirected to just "".

My .htaccess file looks like that but doesn't do anything:

RewriteEngine On 
RewriteRule . [R=301,L]
share|improve this question
up vote 1 down vote accepted

RewriteEngine On
RewriteRule ^(.*)$1 [R=301,L]

Try the above, this should do what you need to do

share|improve this answer
perfect, thanks. – markus Jan 12 '11 at 9:37
Your welcome, let me know if it works :) – The NinjaSysadmin Jan 12 '11 at 9:38

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.