htaccess code please

reza63

New member
Joined
Aug 25, 2008
Messages
4
hi.

i want to redirect the old subdomain link to a new subdomain adress for vbulletin cms.

my old adress link register in google and i am change my subdomain adress want to redirecy the old to new.

http://old.domain.com

redirect to :


http://new.domain.com


or

http://old.domain.com/showthread.php?t=15909

to

http://new.domain.com/showthread.php?t=15909

please help me.
thanks.
 
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^old\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://new.domain.com/$1 [R=301,L]
 
thanks.

i have question.

by this code my old link redirect to new subdomain but one a problem


old adress :

http://forums.domain.com/showthread.php?t=14539

redirect to this one :

http://new.domain.com/forums/showthread.php?t=14539


/forums problem in redirect.

i think this is for old subdomain or folder in the root i delete the old subdomain name : (forums) and folder in root. but the redirect not work.

help me.

thanks.
 
Not too good with regular expressions, but try this:
Code:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^old\.domain\.com/forums/$ [NC]
RewriteRule ^(.*)$ http://new.domain.com/$1 [R=301,L]
 
Back
Top