一页中的三个 HTML 标签
所以我有一个常规的 PHP 页面,其中包括页眉、正文和页脚。
,
<?php include('header.html');
?>
So header.html has <html>... content </html>
与 Footer.html 相同
index.php 也有一个 标签。
那么这对 SEO 或其他方面不利吗?
如何修复它?
谢谢。
So I have a regular PHP page which includes the header, body, and the footer.
So
<?php include('header.html');
?>
So header.html has <html>... content </html>
Same with Footer.html
and the index.php has one <html>Tag too.</html>
So is this bad for SEO or something else?
How to fix it?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
搜索引擎将准确地看到浏览器所看到的内容。因此,他们对您的内容的了解与用户一样多:一无所知。
但是,根据您的问题,您的 HTML 代码非常无效,因为它看起来像这样:
您的模板应该是这样的:
header:
content:
footer:
Search engines will see exactly what the browser sees. So they know as much about your includes as the user: Nothing.
However, according your question your HTML code is horribly invalid as it seems to look like that:
Your templates should be like that:
header:
content:
footer:
它对一切都有害,不仅仅是 SEO,因为它是完全错误的 HTML。
您可以通过从包含中删除无效元素(
标记)来修复此问题。
使用验证器检查生成的页面以查找更多此类错误:http://validator.w3.org
It's bad for everything, not just SEO, because its plain wrong HTML.
You fix it by removing the invalid elements (
<html>
tags) from the includes.Check the resulting page with a validator to find more such errors: http://validator.w3.org
嗯,这是无效的 HTML。因此,如果您因此而在搜索结果中受到惩罚,我不会感到惊讶。
如何修复?只需删除不需要的
标签...? HTML 文档上只需要一个开始和一个结束
标记。
Well, it is invalid HTML. So I wouldn't be surprised if you are penalised in search results because of this.
How to fix? Just get rid of the
<html>
tags that aren't needed...? You only need one opening and one closing<html>
tag on a HTML document.