One site, two domains and SEO...

Using a single web hosting account to host multiple sites

One site, two domains and SEO...

Postby Sym0n » Tue Feb 10, 2009 9:16 am

Hiya,
I've been reading through the info and searching in a bid to be able to fix this myself but I've drawn a blank and so I've admitted defeat.

Here is the situation. I have one site which has two domains (.com and .net). Due to some people having problems accessing the .com domain at work the .net domain is set up as a parked domain on the account. Neither domain use the www. sub.

Up until a server move I'd never run into any problems with having both domains pointing to the same directory but working independently. But then following the move I started getting all sorts of problem with the vBSEO plugin for the forum and it not redirecting to the sitemap as it should. Or the www. sub not being stripped, causing problems with the forum.

I enquired with the author on vBulletin.org and his original suggestions caused redirect loops. Finally he came up with this suggestion, which works for a single domain:

root
Code: Select all
RewriteEngine On
RewriteCond %{HTTP_HOST} !^domain\.com$
RewriteRule (.*) http://domain.com/$1 [R=301,L]


/forum/
Code: Select all
RewriteEngine On
RewriteCond %{HTTP_HOST} !^domain\.com$
RewriteRule (.*) http://domain.com/forum/$1 [R=301,L]
RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]


I've tried to build in a condition and rule for the .net domain but everything I try either breaks the sitemap redirect which then causes problems with SEO or I get a redirect loop and the site is useless. :(

I know I've waffled a bit so I'll summarise.
    www. stripped from all domains no matter the location
    domain.com -> domain.com
    domain.net -> domain.net
    */forum/sitemap_index.xml.gz (or just .xml) -> */forum/vbseo_sitemap/vbseo_getsitemap.php*


aciurczak, who pointed me over here, had a kind of similar problem in this thread with the SEO redirect but only has one domain, just in case that's any help.

Again apologies if I've not been very clear, it's simple in my head but difficult to write down lol.

Thanks for any help or advice.

Sy
Sym0n
 
Posts: 2
Joined: Thu Feb 05, 2009 8:22 am

Postby richardk » Tue Feb 10, 2009 11:52 am

Does any mod_rewrite work? Try this mod_rewrite test.

Also try /.htaccess
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^.+\.(example\.(com|net))$
RewriteRule .* http://%1%{REQUEST_URI} [R=301,L]

and /forum/.htaccess
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^.+\.(example\.(com|net))$
RewriteRule .* http://%1%{REQUEST_URI} [R=301,L]

RewriteRule ^(urllist|sitemap).*\.(xml|txt)(\.gz)?$ /forum/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$0 [L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby Sym0n » Tue Feb 10, 2009 12:00 pm

Richard,
WOW. I don't know how you do it. Seriously thanks so much, that's cracked it!

Thanks again,

Sy
Sym0n
 
Posts: 2
Joined: Thu Feb 05, 2009 8:22 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 17 guests

cron