Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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.