I have a site that has two domains pointing to it, let's call them:
work.mysite.com
play.mysite.com
This is bad practice, so I want to choose work.mysite.com
and make it the canonical URL, permanently redirecting play.mysite.com
to it.
I'm in the root directory for these two domains, in a .htaccess file, banging my head against the cement floor and wishing I wasn't here. Here's what I am currently trying. Tell me how totally wrong I am, please?
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?play\.mysite\.com [NC]
RewriteRule ^/?(.*)?$ http://work.mysite.com/$1 [R=301]
</IfModule>
That gets me a really pretty 500 Internal Server Error. How far off am I?