.htaccess from one subdomain to another subdomain

I had a problem that I’ve solved that I’d like to share with all 1 of my readers. I maintain a website that has 2 subdomains with one of the subdomains existing for the sole purpose of catching a typing error. I want all traffic on that subdomain redirected to another subdomain of the same site. I’m using .htaccess to solve the problem.

sub.domain.com redirected to subs.domain.com

Use this in your .htaccess file:

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^subs\.domain\.com
RewriteRule ^(.*)$ http://subs.domain.com/$1

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

Leave a Reply

You must be logged in to post a comment.