【问题标题】:Confusion regarding SEO friendly PHP links关于 SEO 友好的 PHP 链接的困惑
【发布时间】:2012-02-02 13:42:34
【问题描述】:

SEO 是否会受到 PHP 生成的标题类型的影响?

例如:CamelCased 链接(不易阅读)http://website.com/HelloWorld.php

用hypen链接(易读)http://website.com/hello-world.php

您对此有何看法?应遵循哪些规则以保持我的网页搜索引擎友好?

【问题讨论】:

  • 最好用htaccess,第二个链接对seo更友好
  • @mgraph 你能详细解释一下吗,我不知道。
  • helloWorls 被认为是一个词,但 hello-world google 认为它是 2 个词 hello 和 world
  • @mgraph 我需要了解 htaccess

标签: php html seo


【解决方案1】:

- 是一个单词分隔符。在 Hello-World 中,google 可以识别单词 hello 和 world。 HelloWorld 将被理解为一个词,并且不会对术语 hello world 做出贡献。同样重要的是,下划线字符 (_) 不是单词分隔符,因此 Hello_World 不会被识别为 hello world。

【讨论】:

    【解决方案2】:

    如果你想通过 .htaccess 实现这一点,我建议使用这个:

    RewriteEngine On
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . index.php [NC,L]
    

    删除 .php 并允许更多 SEO 友好的 URL,例如http://website.com/2012/02/04/name-of-the-article。 在 index.php 中使用 $_SERVER['REQUEST_URI'] 捕获 URI 并包含您想要的文件。

    【讨论】:

      猜你喜欢
      • 2014-03-25
      • 2012-04-27
      • 2010-11-01
      • 2011-06-13
      • 2012-09-17
      • 2011-02-14
      • 2018-10-02
      • 2016-04-13
      • 1970-01-01
      相关资源
      最近更新 更多