I'm creating an online community and I'm trying to set up a development server.
Currently, I'm using GIT as my repository. I have both mysite.com and mysite.net; the .com being the primary site.
My Goal:
If a user goes to www.mysite.net they should be 301 redirected to www.mysite.com.
If a user goes to dev.mysite.net they should be asked for a password and then taken to the testbed.. (on mysite.net/)
Can this be done through some crafty htaccess rewrites?
EDIT:
# Here is what I have so Far
RewriteEngine on
#
## Redirect normal users to mysite.com
#
RewriteCond %{HTTP_HOST} ^(www\.)?mysite\.net$ [NC]
RewriteRule (.*) http://www.mysite.com/$1 [R=301,L]
#
## Redirect dev.mysite.net to root directory of mysite.net/
#
RewriteCond %{HTTP_HOST} ^dev.mysite\.net$ [NC]
RewriteRule (.*) http://www.mysite.net/$1 [R=301,L]
# REQUIRE Password for Dev Server
AuthUserFile /home/myaccount/public_html/mysite.net/.htpasswd
AuthGroupFile /dev/null
AuthName "Development Server"
AuthType Basic
require valid-user