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

After trying several solutions I just can't seem to get this to work.

I owned a .org and had urls like

and I now have the .com and want all of them to be taken right to their .com equivalents:


The rules I've tried so far seem to take any URL from .org and just send them to the root of

What htaccess rule do I need?


share|improve this question
up vote 3 down vote accepted

Assuming it's an .htaccess in the DocumentRoot of the .org site (and not the .com site, which would need a RewriteCond to prevent a redirect loop):

RewriteRule ^(.*)$$1 [R=301]
share|improve this answer
This doesn't work - redirects to htaccess is in the documentRoot of the .org – barfoon Sep 28 '11 at 19:45
@barfoon In fact it does not. The $1 contains the information captured in the match; in this case, everything except the root / due to the context of the .htaccess. You likely have some config still in place somewhere in your Apache configuration from another attempt. Change it to something like RewriteRule ^(.*)$$1 [R=301] to verify that this config isn't the one doing the redirect. Check the <VirtualHost>? And make sure you've reloaded the service if you've made changes elsewhere than .htaccess. – Shane Madden Sep 28 '11 at 19:49
I just tried this and that is the result I got. I have not touched the <VirtualHost> on either domain since obtaining both. I even removed all rules on the .com htaccess to see if there was a conflicting rule. No change. – barfoon Sep 28 '11 at 19:51
@barfoon Umm.. what result is it that you got? With what request URL? – Shane Madden Sep 28 '11 at 19:54
I typed in and I got sent to – barfoon Sep 28 '11 at 19:56

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.