.inc file crawlable or not?

Discussion in 'Search Engine Optimization' started by omie, Jul 29, 2009.

  1. #1
    Hello Members,

    Suppose that my website is in PHP. I have define footer section in .inc file and include it in the pages as well. My question is that search engine crawl the links which is define in .inc file or not.

    Thanks,

    Omie
     
    omie, Jul 29, 2009 IP
  2. rhewitt

    rhewitt Member

    Messages:
    113
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    30
    #2
    Unless you have specifically linked to this file, then no. If you're using PHP's include() function to include the footer.inc file then this will be handled server side. The search crawler won't even know its in another file.
     
    rhewitt, Jul 29, 2009 IP
  3. justkidding

    justkidding Active Member

    Messages:
    937
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #3
    It doesn't depend if you have footer content in inc file or not, it depends how you add footer inc file. if you are adding it in server side code then it is crawlable. see the cached file from google to know the result.
     
    justkidding, Jul 29, 2009 IP
  4. willybfriendly

    willybfriendly Peon

    Messages:
    700
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #4
    What do you see when you navigate straight to it?

    Try www.example.com/footer.inc

    My guess, given your question, is that it is web accessible and represents a potential security risk - even more so if it is an .inc file and not .php. This, of course, depends on your server configuration.
     
    willybfriendly, Jul 29, 2009 IP
  5. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #5
    It won't be crawlable if:
    • It is not directly linked to in the HTML output.
    • The code is written to OUTPUT HTML code.
    • The .inc file is outside of the Web directory (usually /root/ or /html_public/ or /www/).

    Of course, these are all best practices to be using in the first place.
     
    Dan Schulz, Jul 29, 2009 IP
    stephen082 likes this.
  6. willybfriendly

    willybfriendly Peon

    Messages:
    700
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Any file in a web accessible folder on the server can be accessed, unless the server is correctly configured.

    footer.inc will probably be served as a text file.

    Worst case? footer.inc has a line like

    <?php require(db_functions.inc); ?>

    Now we go to example.com/db_functions.inc where we find a text version containing username and passwords to the database - probably as root user no less!

    footer.php would be more likely to be parsed before being served.
     
    willybfriendly, Jul 29, 2009 IP
  7. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Which, as I said (without directly saying it), is why the files need to be placed outside of the Web directory.
     
    Dan Schulz, Jul 29, 2009 IP