Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 "http://sub.mynewdomain.com".

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

RewriteEngine On 
RewriteRule . http://sub.mydomain.org/ [R=301,L]
share|improve this question

1 Answer 1

up vote 1 down vote accepted

RewriteEngine On
RewriteRule ^(.*) http://sub.domain.org/$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

 
discard

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.