On my website I have a development folder and a folder for websites I’m hosting. I want to keep search engine robots OUT of my developmental folder, but what about my hosted domain folder? Should they be kept out of there as well?
I think this is the code I’m supposed to use in the robots.txt file, but where do I put it?
Are you saying that you host client sites in subfolders/sub domains of your site?
D
Yes, that’s how GoDaddy works. The actual domain is hosted in a subdirectory, but to the browser it looks like a top level domain, sort of like a subdomain.
The robots.txt should be wherever the main index.html is for the particular site you are trying to control. So if in the GoDaddy Bizarro-world that is public_html/www.somedomain.com/index.html, then you would put the robots.txt file at public_html/www.somedomain.com/robots.txt
Walter
On Oct 14, 2012, at 7:47 PM, RavenManiac wrote:
On 14 Oct 2012, 10:48 pm, DeltaDave wrote:
Are you saying that you host client sites in subfolders/sub domains of your site?
D
Yes, that’s how GoDaddy works. The actual domain is hosted in a subdirectory, but to the browser it looks like a top level domain, sort of like a subdomain.
Thanks Walter. That makes sense. But, what about hosted websites?
Since I’m using a CMS with some of my customers’ websites, I would prefer that all searches go through www.client1.com instead of the subfolder where the website files actually exists, which in this case would be www.mycompany.com/client1.
If the user went directly to the subfolder, which is possible, that would result in the user seeing CMS pages with no data.
Thanks Walter. That makes sense. But, what about hosted websites?
Since I’m using a CMS with some of my customers’ websites, I would prefer that all searches go through www.client1.com instead of the subfolder where the website files actually exists, which in this case would be www.mycompany.com/client1.
If the user went directly to the subfolder, which is possible, that would result in the user seeing CMS pages with no data.
That’s a job for mod_rewrite in Apache. In your .htaccess file, very near the top, add something like this:
Make sure that the preferred domain name is present in both the second and third lines. Also, make sure that if you already have a RewriteEngine On line, you do not duplicate it. Just add the next two lines after it. Note the backslashes used to escape the dots in the URL in the second line. Those are critical.
Also, always use a proper programmer’s text editor to create or alter your .htaccess file, but you already knew that…