Does Google crawl include/require files in PHP?

落爺英雄遲暮 提交于 2019-12-29 02:04:51

问题


I am new to php and I am working on a website using php that has a navigation bar. This website is going to be fairly large (above 30 pages) and I don't want to have to change my navigation bar on every single page if I ever find a need to change it.

I also want Google's spider to follow the links on the navigation bar. Does Google follow links inside of an include file if I were to put the navigation bar in an include file? Is an include file the right way to have the same navigation bar on every page? Any help that anybody can offer would be greatly appreciated!


回答1:


Search engines don't see your PHP code. They see what everyone else sees, the final HTML output of your code. So using includes wont affect their ability to find and crawl that content.




回答2:


Google will read the output of your PHP files as it crawls the site. If you would like to see what the Google Bot will see, go to whatever page you'd like to test and view it's source. To view source in most browsers you simply right click on the background of the webpage and click "View Source". The source code that is displayed (HTML/CSS/Javascript) is exactly what the Google Bots will read.

PHP is a server-side language. This means that the server interprets the PHP code and then sends the output to the end-user's browser. It would be wise to read up on the differences of server-side and client-side languages. Here is an excellent post on this: https://softwareengineering.stackexchange.com/a/171210



来源:https://stackoverflow.com/questions/26938441/does-google-crawl-include-require-files-in-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!