Here is my question, Recently I moved my site from blog.mysite.com to www.mysite.com.
Then I added 301 permanent redirection using this code in .htaccess file.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^blog\.mysite\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.blog\.mysite\.com$
RewriteRule ^/?$ "http\:\/\/www\.mysite\.com\/" [R=301,L]
Everything was OK, and when I go to my site by typing blog.mysite.com it automatically redirected to www.mysite.com.
But, I found that when I click a Google search result of my old site doesn't redirect to the new site.
Guess Google result URL is
http://blog.mysite.com/how-to-create-simple-but-fully-styled-navigation
Though it doesn't redirect to
http://www.mysite.com/how-to-create-simple-but-fully-styled-navigation
It only goes to the old URL which is
http://blog.mysite.com/how-to-create-simple-but-fully-styled-navigation
which shows my hosting provider's 404 Error page.
So, then what I did was creating a custom 404 error page and added a php code to get the Google's search result URL and replace the word 'blog' with 'www' then redirecting to
http://www.mysite.com/how-to-create-simple-but-fully-styled-navigation
So, now everything's working perfectly and no any error pages.
But I want to know if what I've done is OK with SEO logics. I've heard that 301 permanent redirection tells the Search engines that the site has moved. And where the new site is.
I want to know if there's no damage to 301 redirection after I've created custom 404 page and added a tricky redirection...
Thanks... Hope you understand. :-)