View Single Post
Old 03-04-2008, 01:07 AM   #1 (permalink)
Dan
The Wanderer
 
Dan's Avatar
 
Join Date: Dec 2007
Location: England
Posts: 15
Thanks: 6
Dan is on a distinguished road
Default redirecting to subdomain via htaccess

Hello everyone!

Question. I have over 2000 URLs I'm trying to successfully 301 redirect to subdomains using the root htaccess file.

Code:
domain.com/same/NAME to NAME.domain.com
Note the "same" directory is a constant throughout all the URLs.

Instead of writing each URL line by line:
Redirect 301 /same/1 http://1.domain.com
Redirect 301 /same/2 http://2.domain.com
Redirect 301 /same/3 http://3.domain.com

I was thinking is it possible to redirect it all using 1 line, like:
Code:
Redirect 301 /same/$1 http://(.*).domain.com
EDIT: I already have the rewrite of the subdomains working, so just to clarify. All i'm looking to do is redirect the old pages to the new ones.
Dan is offline  
Reply With Quote