phpBB SEO
Boards
Directory  
SEO  
Downloads
  phpBB SEO : Search Engine Optimization, Directory, Forums  
Index
Forums
Annuaire
Référencement
Télécharger
 
  Search Rechercher
    Register
Username :  Password :  Log me on automatically each visit  
S'enregistrer  
 
   
Rederecting a 301 from sub domain to main domain

 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » Apache mod Rewrite
::  
Author Message
Peter77
phpBB SEO Team
phpBB SEO Team


Joined: 10 May 2006
Posts: 512
Location: Michigan

Rederecting a 301 from sub domain to main domainPosted: Mon Oct 30, 2006 5:29 am    Post subject: Rederecting a 301 from sub domain to main domain

Turns out my highest PR for me, according to Google's Crawl stats page, comes from an old subdomain.

I was doing some searching on this and found a solution that works.

Code:
RewriteCond %{HTTP_HOST} oldsubdomain.x.com [NC]
RewriteRule (.*) http://www.xcom/ [R=301,L]



Anyway, I was wondering if you see any conflicts/concerns with your SEO / rewrite work?

All seems to be working normally. Smile


Thanks!


Last edited by Peter77 on Fri May 11, 2007 9:24 pm; edited 3 times in total
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 14327

Rederecting a 301 from sub domain to main domainPosted: Mon Oct 30, 2006 4:43 pm    Post subject: Re: Rederecting a 301 from sub domain to main domain

Well, what you did is almost ok if you put these rewriterules in the oldsubdomain.mysite.com's .htaccess.
A more correct way would be :
Code:
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^oldsubdomain\.mysite\.com$ [NC]
RewriteRule (.*) http://www.mysite.com/ [R=301,L]


You can as well, if possible, just make the oldsubdomain.juarol.com to be linked to the same folder as you main domain (in the root folder) so that the www prefix redirection you already have there will take care of this one as well As long as you are using the negative case :

Code:
RewriteCond %{HTTP_HOST} !^www\.mysite\.com$ [NC]
RewriteRule (.*) http://www.mysite.com/$1 [R=301,L]



++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
Peter77
phpBB SEO Team
phpBB SEO Team


Joined: 10 May 2006
Posts: 512
Location: Michigan

Rederecting a 301 from sub domain to main domainPosted: Mon Oct 30, 2006 5:11 pm    Post subject: Re: Rederecting a 301 from sub domain to main domain

Great... it works well. So then if I have the old subdomains .htaccess link back to my main, it then wont be necessary to add it to my main .htaccess, right? And Oops, I tottaly missed the backward slash.

Thank you for taking the time to explain to me the correct way. Smile
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 14327

Rederecting a 301 from sub domain to main domainPosted: Mon Oct 30, 2006 5:33 pm    Post subject: Re: Rederecting a 301 from sub domain to main domain

The one in your main domain will take care of all cases.
If set like I posted, any domain or sub-domain linked to this main domain will be http 301 redirected Wink

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
Peter77
phpBB SEO Team
phpBB SEO Team


Joined: 10 May 2006
Posts: 512
Location: Michigan

Rederecting a 301 from sub domain to main domainPosted: Mon Oct 30, 2006 6:08 pm    Post subject: Re: Rederecting a 301 from sub domain to main domain

dcz wrote:
The one in your main domain will take care of all cases.
If set like I posted, any domain or sub-domain linked to this main domain will be http 301 redirected Wink

++



That's what I wanted to achieve. Thank you very much. Very Happy
Back to top
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » Apache mod Rewrite
Page 1 of 1

Navigation Similar Topics

Jump to: