Forum Moderators: phranque

Message Too Old, No Replies

how to do a 301 of individual pages from subdomain

to a folder on main domain when the files are renamed

         

zollerwagner

9:59 am on Mar 28, 2008 (gmt 0)

10+ Year Member



After reading here and testing all night I'm still stumped.

The third part of this code works in redirecting everything in an old subdomain to the index age of a folder on the main domain.

But I've been unable to redirect individual pages to renamed pages. Two of the variations I've tried appear below.

I'm using .htaccess .

What am I doing wrong?


#Doesn't work for individual page
redirect 301 /services http://www.domain.com/en/products/

RewriteEngine on

#Doesn't work for individual page
RewriteCond %{HTTP_HOST} ^en.domain.com/services$ [OR]
RewriteCond %{HTTP_HOST} ^www.en.domain.com/services$
RewriteRule ^(.*)$ http://www.domain.com/en/products/ [R=301,L]

#Works for entire subdomain
RewriteCond %{HTTP_HOST} ^en.domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.en.domain.com$
RewriteRule ^(.*)$ http://www.domain.com/en/ [R=301,L]