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