Guest Posted October 16, 2013 Share Posted October 16, 2013 My site is available through two means: 1) the correct way, through www.mysite.com 2) Through my hosting account www.myhostingdomain.com/my_shop_directory Mysite.com points to the my_shop_directory on my hosting domain. Obviously, I only want mysite.com indexed by Google. If I used robots.txt to disallow myhostingdomain.com/my_shop_directory, would that impact mysite.com at all? I hope that is understandable! Thanks Link to comment Share on other sites More sharing options...
Guest Posted October 16, 2013 Share Posted October 16, 2013 Hi, It looks like your configuration file is setup wrong but in some way correct if it`s working. You need to change the domain name in bouth configuration file so that a visitor opens your shop ""www.mysite.com" he stay`s there. Link to comment Share on other sites More sharing options...
Guest Posted October 16, 2013 Share Posted October 16, 2013 Thanks @@imop, but you've misunderstood me. My site is working perfectly, no issues in the config files or anything. I'll try to explain it a bit better. My shop is "mysite.com", however the domain "mysite.com" points to "myhosting.com/myshop". The same goes for every page, "mysite.com/product" is really "myhosting.com/myshop/product". The customer only ever sees "mysite.com", but "myhosting.com/myshp" also exists. I do not want Google to index the "myhosting.com" domain, but I obviously do want it to index the "mysite.com" domain. My query is, because "mysite.com" is really "myhosting.com/myshop", if I use robots.txt to disallow "myhosting.com/myshop", will that also disallow "mysite.com"? Is that any clearer?? So hard to explain in text! Link to comment Share on other sites More sharing options...
Guest Posted October 16, 2013 Share Posted October 16, 2013 If a shop adress remains "mysite.com" for your site if a visitor will look for any page then it`s ok to disallow robots look for "myhosting.com/myshop" But if a visitor gose to "mysite.com" and is redirected to "myhosting.com/myshop", then it`s not a good idea. Link to comment Share on other sites More sharing options...
Guest Posted October 16, 2013 Share Posted October 16, 2013 Worked, bots are blocked on my hosting domain but can still visit my shop domain, exactly as I wanted. Thanks! Link to comment Share on other sites More sharing options...
MrPhil Posted October 16, 2013 Share Posted October 16, 2013 So you're saying that visitors are getting to your shop through http://server.host.com/yourAccount/?'>http://server.host.com/yourAccount/? If they're only undesirable bots (i.e., not Google, etc.) you might be able to block them through robots.txt. However, the right way would be to use /.htaccess (assuming you're on an Apache server) to redirect visitors to your desired domain name: RewriteEngine On RewriteCond %{HTTP_HOST} ^server\.host\.com [NC] RewriteRule ^yourAccount/?(.*)$ http://www.mysite.com/$1 [R=301,L] RewriteCond %{HTTP_HOST} ^mysite\.com [NC] RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L] This assumes that http://server.host.com/yourAccount/ actually comes through your /.htaccess and is recognized as the domain name and URI. If it doesn't, no telling what's going on. Notes: 1. Ill-mannered bots will ignore robots.txt anyway, but they can't ignore .htaccess. 2. If you ever need to access your site via server.host.com, you might be blocked. Moral of the story: never give out your temporary domain (server.host.com/yourAccount) to the public -- always use your proper domain name. Link to comment Share on other sites More sharing options...
Guest Posted October 17, 2013 Share Posted October 17, 2013 Thanks Phil. As far as I know, real visitors never went to the hosting domain, it was just for about half an hour as I was changing hosts I had accidentally linked to the hosting rather than shop domain and Googlebot found it. But using a robots.txt seems to have fixed that, so all is good now. All links point where they should and Googlebot is on the right site. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.