Googlebot and PHP Include

Discussion in 'Google' started by vastbeyond, Apr 20, 2007.

  1. #1
    Silly question but just wanted to check what the general consensus is. If I disallow a certain page from a spider like Googlebot (with robots.txt), but I use a PHP include statement to include its contents on another page, will a spider still index that other page?

    I am assuming it will still be indexed, since a spider cannot "see" server-side instructions like that, but maybe someone out there knows better than me??
     
    vastbeyond, Apr 20, 2007 IP
  2. BILZ

    BILZ Peon

    Messages:
    1,515
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I don't see how the bot would be aware since that is a server side action. But i think the only way to know for sure is to check Google's cache of that page.
     
    BILZ, Apr 20, 2007 IP
  3. nfd2005

    nfd2005 Well-Known Member

    Messages:
    295
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    130
    #3
    The include will not be spidered by the bot unless you actually link to the file you are including...

    include "myfile.php";
    PHP:
    <a href="myfile.php">Link to include file.</a>
    HTML:
    Otherwise it won't be spidered and will appear as if there was only one web page on the server.

    Your page + included page = Your Page (with more content)
     
    nfd2005, Apr 20, 2007 IP
  4. brealmz

    brealmz Well-Known Member

    Messages:
    335
    Likes Received:
    24
    Best Answers:
    3
    Trophy Points:
    138
    #4
    i am no expert but i can clearly see that it will not index that "other page". if you still doubt it will index that other page use "no follow" to your link to other page but not necessary. :)

    check your robots.txt at google sitemap.
     
    brealmz, Apr 20, 2007 IP
  5. Jean-Luc

    Jean-Luc Peon

    Messages:
    601
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hi,

    It is not a matter of consensus. Just logic.;)

    Page A will not be indexed; page B will be indexed.

    Jean-Luc
     
    Jean-Luc, Apr 20, 2007 IP
  6. Erind

    Erind Peon

    Messages:
    663
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #6
    hmmmmmm. This isa bit of a brain buster..

    php includes aren't seen by users. If I include a page within a page, it will just look like a page. Both are indexxed. Not as separate, but as 1, usually the "mother" page. Now, if you exclude a page from googlebot, it won't be indexed by itself, but sinceit is includedand the page isn't seen as a new page, it will be indexed. Its wierd:

    pageA.php
    pageB.php (robots.txt exclude)

    If the spider goes to pageB.php it won't be indexed as a page, but if it included in pageA.php, the content of pageB.php will be indexed, but it will only show as pageA.php. You might get something like this in search result in google:

    Page A title blah blah
    Page A content blah blah blah Page B content Blah Blah
    http://yourdomain.com/pageA.php

    Hope that made sense ;)
     
    Erind, Apr 20, 2007 IP