Submit Your Article Forum Rules

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 37

Thread: robots.txt and htaccess for multiple domains on one hosting account

  1. #1
    Senior Member
    Join Date
    Aug 2006
    Posts
    160

    robots.txt and htaccess for multiple domains on one hosting account

    I know there are several of you that are running several domains from a single hosting account, and I am thinking about doing the same. I have spent the last 2 days reading and reading, and I see that it is recommended to set up a robots.txt file to keep the spiders from lumping all domains in the hosting account into one.

    I don't understand that thought... Don't the spiders follow links? If there are no links between the different domain names, then they stop spidering when they have finished spidering the one domain that they came in on. Is that not so? Do they actually go into the site directory itself and root around looking for all pages within a hosting account? If that is the case, then how do you tell a spider to only look at the one section (domain name) and then at the same time have them spider all your other domain 'sections' because you want those included in the search engines as well? I'm confused big time.

    All the stuff I have been reading also suggests that you create a .htaccess file in the root directory of the hosting account to sort out what pages to display when a certain URL is specified. My host has what they call a domain pointing tool that will send visitors to the appropriate folder of your account depending on which domain name was typed in the browser. I imagine this is done by that very same .htacces file, so in essence, there already exists such a file and to create another would likely be suicide. I'm sure this file could also be edited, but I understand that certain commands in that file need to be in a particular order, and if I mess that up, I'm in trouble again!

    So... what I am asking for is some clear guidance as to what I need to do to host several domain names that are each associated with a different web site, all under a single hosting plan? And, will visitors be able to tell that they are looking at a site that is hosted under another primary account?

    To better understand what I am talking about, in my signature file, you can see that I have 2 distinct topics (sites) on the same host account. If I were to purchase another domain name for the second site (lets say 'friends.com'), can I make it look as if it is hosted on its own account (both for SEO and visitors)? If so, how exactly do I accomplish that?

    Thanks in advance for your input.

  2. #2
    WebProWorld MVP
    Join Date
    Aug 2003
    Posts
    1,039

    Re: robots.txt and htaccess for multiple domains on one hosting account

    The following assumes you are on a cPanel based server and that the host is keeping it current.

    When you are in cPanel there's the option Addon domains, click it and you enter the information for the domain you wish to add to your account.

    If you enter example.com then by default cPanel will set the home account to public_html/example.com that is it creates the web space for the new domain inside the web space for the accounts domain, this allows you to access it as both http://example.com and http://yourdomain.com/example.com

    The simple solution is when adding the domain edit the Document Root field and remove public_html from it so it just becomes example.com now your new domain has it's web space outside of the accounts web space and so can ONLY be accessed by its domain and not that of the account.

    As a side note this is also true when creating sub-domains.

    Now as you can't access your new domains web space via your main account domain there's no difference to hosting 2 or more domains on the same account or having 2 or more accounts on the same server.

    If however your host is using a control panel which will not allow you to create web space for the addon domains outside of your main web space then either change host or you have to use rules in a .htaccess file placed within the folder assigned to each addon domain.

    So if you have the addon domain example.com and it's web space is public_html/example.com then in public_html/example.com you'd place an .htaccess containing the following:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
    RewriteRule (.*) http://www.example.com/$1 [R=301,L]

    That rule simply states if the domain name used to access the site is not www.example.com the do a permanent redirect to http://www.example.com/

    Now you can't access the content via the main account domain again, its not as elegant as keeping the web space separate but it works and again there's no difference between 2 or more domains on one account or many accounts on one server.

    I hope that helps if not ask away and I'll do my best to explain.

  3. #3
    WebProWorld MVP kgun's Avatar
    Join Date
    May 2005
    Location
    Norway
    Posts
    7,999

    Re: robots.txt and htaccess for multiple domains on one hosting account

    I think you are talking about what is called add on domains and not sub domains. I have an add on domain solution by two different hosters. On the web server the add on domains are organized as subfolders of the main domain. There are two different solutions:
    1. The simplest, one ftp password. The add on domains are uploaded as to the main domain. The various domains can share one central CSS styling file located in the sub folder of the main domain.

      Example:

      Main domain: Kjell Bleivik

      Add on domain: DigitalStart.net: The starting point for English speaking surfers and webmasters
    2. Each domain has its own unique ftp password. The add on domains are seemingly uploaded to its own URL, but it is organized on the web server as the above, that is as a sub folder to the main domain.

      Example

      Main domain: ForumNorway.com :: Index

      Add on domain: Meta Search Engine and search resources: SurfToolbar.com
    The first is of course easiest.

    I use a unique robots.txt file for each domain regardless of solution. Regarding .htaccess files you need to be very careful. .htaccess settings on the main domain carries through to the add on domains (subfolders). Example:

    On the main domain: You disallow access from IP region Y.

    On one of the add on domains you want access from IP region Y. Then you have to make a separate .htaccess file for this domain (folder) where you allow access from IP region Y.

    To sum up:

    Exept for styling, I treat each add on domain as a unique domain, even if there may be overlap. That is also easiest if I later want to move an add on domain to its own unique Ip or sell the site. You can upload the code as is.

  4. #4
    WebProWorld MVP SemAdvance's Avatar
    Join Date
    Dec 2005
    Posts
    1,037

    Re: robots.txt and htaccess for multiple domains on one hosting account

    Quote Originally Posted by Tarzan2 View Post
    I know there are several of you that are running several domains from a single hosting account, and I am thinking about doing the same. I have spent the last 2 days reading and reading, and I see that it is recommended to set up a robots.txt file to keep the spiders from lumping all domains in the hosting account into one..
    Actually robots.txt use should be per domain, not per server.

    Quote Originally Posted by Tarzan2 View Post
    I don't understand that thought... Don't the spiders follow links?
    Yes


    Quote Originally Posted by Tarzan2 View Post

    If there are no links between the different domain names, then they stop spidering when they have finished spidering the one domain that they came in on. Is that not so?
    .
    No its not so...Spiders crawl servers indexing the pages they find there and happen to follow the links on those pages (they do not always follow all links)

    Quote Originally Posted by Tarzan2 View Post
    Do they actually go into the site directory itself and root around looking for all pages within a hosting account? If that is the case, then how do you tell a spider to only look at the one section (domain name) and then at the same time have them spider all your other domain 'sections' because you want those included in the search engines as well? I'm confused big time.
    .
    Yes spiders will root through all directories if allowed. As above robots.txt is to be used per domain.

    Quote Originally Posted by Tarzan2 View Post

    All the stuff I have been reading also suggests that you create a .htaccess file in the root directory of the hosting account to sort out what pages to display when a certain URL is specified.

    .
    htaccess files are usually per domain.
    Quote Originally Posted by Tarzan2 View Post

    My host has what they call a domain pointing tool that will send visitors to the appropriate folder of your account depending on which domain name was typed in the browser. I imagine this is done by that very same .htacces file, so in essence, there already exists such a file and to create another would likely be suicide. I'm sure this file could also be edited, but I understand that certain commands in that file need to be in a particular order, and if I mess that up, I'm in trouble again!
    Hostgator has a resellers account for $35.00 per month where I host 100+ domains with no problems.

    Quote Originally Posted by Tarzan2 View Post
    So... what I am asking for is some clear guidance as to what I need to do to host several domain names that are each associated with a different web site, all under a single hosting plan? And, will visitors be able to tell that they are looking at a site that is hosted under another primary account?

    To better understand what I am talking about, in my signature file, you can see that I have 2 distinct topics (sites) on the same host account. If I were to purchase another domain name for the second site (lets say 'friends.com'), can I make it look as if it is hosted on its own account (both for SEO and visitors)? If so, how exactly do I accomplish that?

    Thanks in advance for your input.
    As noted above....

    Hope this helps

  5. #5
    Member John's Avatar
    Join Date
    Oct 2006
    Location
    Brisbane - Australia
    Posts
    76

    Re: robots.txt and htaccess for multiple domains on one hosting account

    Quote Originally Posted by speed View Post
    If you enter example.com then by default cPanel will set the home account to public_html/example.com that is it creates the web space for the new domain inside the web space for the accounts domain, this allows you to access it as both http://example.com and http://yourdomain.com/example.com

    The simple solution is when adding the domain edit the Document Root field and remove public_html from it so it just becomes example.com now your new domain has it's web space outside of the accounts web space and so can ONLY be accessed by its domain and not that of the account.
    Am I right when I say that the above only works if you have the directory that contains all the files for example.com is outside the public_html directory.
    If your add-on domain files are a subdirectory of public_html, and you remove the public_html/ from the filepath, how can your files be found ...

  6. #6
    Senior Member
    Join Date
    Dec 2007
    Posts
    526

    Re: robots.txt and htaccess for multiple domains on one hosting account

    They follow the surface links on the web... There are certain rules with sub-domains that they follow as well... If you do not link up sub-domains to and from each other in the HTML, then they will not index as one entity. Rules like nofollow might prevent some spiders from crawling a page and others from indexing it.

    That being said... I have always thought a robots.txt is just a bad move. If you don't want something on the web... why would you place a file in your directory showing everybody where the stuff your hiding is.

    Why not IP whitelist in htaccess, or password protect the stuff you do not want indexed, or for that matter, don't link to it. jmo...

    The best way to get to know a search engine and how it indexes your site is with the site: opertor....

    http://www.google.com/search?q=site:yourdomain.com

    The next best thing after that is to start tracking the Google, Slurp and MSN bot in your log files...

  7. #7
    WebProWorld MVP SemAdvance's Avatar
    Join Date
    Dec 2005
    Posts
    1,037

    Re: robots.txt and htaccess for multiple domains on one hosting account

    Quote Originally Posted by MrGamm View Post

    Why not IP whitelist in htaccess, or password protect the stuff you do not want indexed, or for that matter, don't link to it. jmo...
    Because spiders crawl servers and as such do not need links to find any intellectual property stored on your server be it images videos docs pdfs or pages of code.

    The spiders happen to follow the links they find......

  8. #8
    WebProWorld MVP
    Join Date
    Aug 2003
    Posts
    1,039

    Re: robots.txt and htaccess for multiple domains on one hosting account

    Quote Originally Posted by John View Post
    Am I right when I say that the above only works if you have the directory that contains all the files for example.com is outside the public_html directory.
    If your add-on domain files are a subdirectory of public_html, and you remove the public_html/ from the filepath, how can your files be found ...
    If you have a cPanel based host when you add the new domain to your account you choose where the folder for that domain stores it's files, so if my account is speed the the default is /home/speed/public_html/, what I'm saying is as you add the domain create its storage area as /home/speed/example.com/

    I only deal with cPanel so while other control panels may allow it I couldn't swear to it.

    If you've already added the domain to your account and it's files are in your public_html e.g. public_html/example.com, then you'd need to update the information for the addon and move the files to the new location. At which point just use a .htaccess in the addons folder is easier.

  9. #9

    Re: robots.txt and htaccess for multiple domains on one hosting account

    There is sometimes a misundertanding about what a web spiders actually does and how it access documents.
    A spider does not actually GO to a web server to fetch whatever is inside that server.

    A spider follow links from one web page to another web page because a web site is structured to allow visitors (humans and bots) to go from one web page to another other page so as long as there is a link from the first page to the other pages.

    When a Visitor (human & web bot) encounters a link be it to a web page in the same domain or to a different domain s/he or it may choose to follow that link. This explain why a new website can be indexed within a few days while another one may take a month or so because the search engine encounter a link to that site while crawling anothe high traffic website.

    So even when you host several web sites (different domain names) in the same server, they are considered as different entities as long as you link pages from site1.com to web pages of site2.com suing the full URL (i.e http://www.site.com/page-to-visit.html)

    If rootsite.com, site1.com and site2.com happens to be hosted shared in the same hosting account, most of the time each domain is allocated a subfolder such as site1.com and site2.com. In that case using a link such as href="/site2.com/page-to-visit.html" from a webpage belonging to root site (say rootsite.com) might be problematic because "site2.com" will be considered as a subdirectory not a seperate website or domain name.

    So the rule of thumb is to use full path when linking wepages from one domain name to another whether both web site share a hosting space or not.

    With a proper linking, you can host as many web sites in the same server space as you want without any fear of one site being accidently indexed as part of another: that's what shared hosting is about.

  10. #10
    Junior Member johnnyjohnny's Avatar
    Join Date
    Mar 2008
    Posts
    13

    isn't it a GooD thing?

    i have 2 websites that were once hosted in 2 different accounts, with two different ftp passwords...

    i switched to another host, and now the files are on the same account, though in separate folders, and use the same ftp passwords...

    if anyone knows if these websites will be indexed together, i'd be thankful to know...HoWEVER, my QUESTiON iS:

    what's wrong with two sites being indexed as one? won't the strength of one site bring the other uP in rankings? and if a site is weak in it's own subject matter, getting a lift in rankings albeit from other subject matter, still leaves it ahead of the game, doesn't it?

    my case is that i've a strong, pagerank of 3 website for vintage watches...i also have a photography website with no pagerank, and is ranked mediocre as best for it's own keywords...doesn't the weaker site get a boost if these are seen as connected? and isn't the stronger site still strong vis a vis it's pages that rank high in search pages for the keywords on those pages?

    thanks for any info

Page 1 of 4 123 ... LastLast

Similar Threads

  1. 1 single account at G\Y\MSN for multiple sites; or different accounts for each site?
    By Clint1 in forum Webmaster Resources Discussion Forum
    Replies: 41
    Last Post: 11-10-2009, 04:41 PM
  2. Hosting Multiple Domains
    By jwg1800 in forum Domain Discussion Forum
    Replies: 3
    Last Post: 11-06-2005, 09:39 PM
  3. .htaccess account addition after payment.
    By swick in forum eCommerce Discussion Forum
    Replies: 2
    Last Post: 11-16-2004, 03:17 PM
  4. Blocking IP addresses, domains (.htaccess help)
    By TN Todd in forum Web Programming Discussion Forum
    Replies: 15
    Last Post: 10-13-2004, 09:22 PM
  5. One 2checkout account can be use on multiple website????
    By yowow in forum eCommerce Discussion Forum
    Replies: 1
    Last Post: 07-25-2004, 11:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •