Forum Moderators: open

Message Too Old, No Replies

Will Search Engines Index File Inside PHP Include

         

brit7

11:28 am on Jan 9, 2007 (gmt 0)

10+ Year Member



Supposed that I have created an html page with contents coming from a separate directory using php include. Example:

<html>
<body>
<?php include("http://www.mysite.com/contents/article.html")?>
</body>
</html>

In the above example, will "article.html" also be indexed by search engines if the main page has already been so?

Will it be like linking the main page to "article.html"? Like in the case of <a> tag in html.

Please bear with me I'm no technical guy.

phranque

11:33 am on Jan 9, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



the php script is run by the web server and assembles the document by including the article.html file.
the assembled document is served to the search engine spider, which doesn't see the "include" per se, just the results thereof.

drizzle

11:44 am on Jan 9, 2007 (gmt 0)

10+ Year Member



In your example you will have just only one indexed web page - article.php

Try to execute you example and than check the browser output (Ctrl+U in Mozilla), you will see the following:
<html>
<body>
content from your article.html web page here instead your php code
</body>
</html>

So, brit7, if you do not have any links to your article.html from the web or from the other pages of your site article.html won't be in index at all.
PHP include is not substitute to <a> html tag.

brit7

2:25 pm on Jan 12, 2007 (gmt 0)

10+ Year Member



Hey guys! I now get it. Thanks for taking time to reply.