Forum Moderators: phranque

Message Too Old, No Replies

how do I switch subdomains using mod rewrite

how do I switch subdomains using mod rewrite

         

shagreel

4:09 pm on Aug 13, 2007 (gmt 0)

10+ Year Member



I am trying to move certain content from one subdomain to another using mod rewrite. I am just wondering if there is a good way to do this?

I would like any traffic going to a.example.com/test to be 301 redirected to b.example.com/test

Thanks for any help,
paul

jdMorgan

9:22 pm on Aug 13, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use RewriteCond in mod_rewrite, testing the %{HTTP_HOST} variable for "^a\.example\.com" followed by a RewriteRule of all URL-paths to b.example.com/same-URL-paths with a permanent redirect.

Jim