Posted By

canarymason on 07/26/09


Tagged

htaccess


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

mattrichardson


redirect from a subdomain to the main domain


 / Published in: Apache
 

Needed to retire a staging domain, so I'm redirected all traffic to the equivalent page in the root directory in the .htaccess file

  1. RewriteEngine On
  2. RewriteBase /
  3. RewriteCond %{HTTP_HOST} ^staging.example\.com$ [NC]<br />RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

Report this snippet  

You need to login to post a comment.