UQ13A Posted May 21, 2012 Share Posted May 21, 2012 Hi, I currently have two websites each with different hosts. www.websiteA.com and www.websiteB.com . WebsiteB's content is hosted on websiteA as a subdomain (www.B.websiteA.com) When you visit websiteB.com it redirects to B.websiteA.com. How would i get google to show search results for websiteB, not www.B.websiteA.com Thank You Link to comment https://forums.phpfreaks.com/topic/262883-domain-and-sub-domain-robots-help/ Share on other sites More sharing options...
smoseley Posted May 22, 2012 Share Posted May 22, 2012 Just drop this in an .htaccess file in the subdomain's root: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !www.websiteB.com$ [NC] RewriteRule ^(.*)$ http://www.websiteB.com/$1 [L,R=301] Edit: actually, come to think of it, you probably already have a rewrite rule somewhere else... eliminate that one first, or you'll get a redirect loop Link to comment https://forums.phpfreaks.com/topic/262883-domain-and-sub-domain-robots-help/#findComment-1347461 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.