I have 40k+ indexed google pages for one of my subdomains called name; like http://name.mysite.com now i want to move this subdomain to its own domain name like http://www.name.com but at the same-time i want to keep all the already indexed links valid; that is all pages like http://name.mysite.com/nme.php?var=.... should automatically redirected to http://www.name.com/nme.php?var=.... how can I achieve something like that ?
I have already registered a main domain as www.name.com but I am not sure how can I rewrite the rules, where and how ?
For what u want edit this below code and add it to your .htaccess #Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^www.olddomain.com$[OR] RewriteCond %{HTTP_HOST} ^olddomain.com$ RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L] Code (markup):
yes, of course; so according to what I have in the first message the code will be something like this: #Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^www.name.mysite.com$[OR] RewriteCond %{HTTP_HOST} ^name.mysite.com$ RewriteRule ^(.*)$ http://www.name.com/$1 [R=301,L] Code (markup): please let me know if I am missing anything
Oh, I see. so here it is... #Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^name.mysite.com$ RewriteRule ^(.*)$ http://www.name.com/$1 [R=301,L] Code (markup): thank you again