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]
link|improve this question

80% accept rate
feedback

1 Answer

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

link|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
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.