rugbyjack2005
Power Member
- Oct 2, 2011
- 539
- 50
Hi all,
Ages ago i set up a blog on one of my sites and created a blog subdomain - blog.mysite.com. Obviously Google sees this as a separate site and i don't want it to. How do i set up a 301 redirect so that blog.mysite.com redirects to www.mysite.com/blog ?
This is where i have got so far and it doesn't work
The first part is the redirect from non www. to www but i included it as well just encase it is messing up the other part. Help would me much appreciated as i am going round in circles at the moment!
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mysite.com
RewriteRule (.*) http://www.mysite.com/$1 [R=301,L]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^blog.mysite.com
RewriteRule (.*) http://www.mysite.com/blog/$1 [R=301,L]
Ages ago i set up a blog on one of my sites and created a blog subdomain - blog.mysite.com. Obviously Google sees this as a separate site and i don't want it to. How do i set up a 301 redirect so that blog.mysite.com redirects to www.mysite.com/blog ?
This is where i have got so far and it doesn't work
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mysite.com
RewriteRule (.*) http://www.mysite.com/$1 [R=301,L]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^blog.mysite.com
RewriteRule (.*) http://www.mysite.com/blog/$1 [R=301,L]