dongxueji2838 2012-02-03 18:32
浏览 76
已采纳

PHP URL的SEO?

I have many thousands of profile URLs that currently look like this:

view_profile.php?id=12345

Is there any SEO benefit for me to change them to something like:

member12345.htm

I can make the change in my .htaccess file but I'm curious if it's even needed?

  • 写回答

4条回答 默认 最新

  • douye4051 2012-02-03 18:41
    关注

    The easy solution edit your .htaccess file:

    RewriteEngine On
    RewriteBase /
    
    RewriteRule ^member([0-9]+)\.htm(l)?$ view_profile.php?id=$1 [L,NC]
    #or /member-1234.html
    RewriteRule ^member\-([0-9]+)\-([^/])\.htm(l)?$ view_profile.php?id=$1 [L,NC]
    #or /member-1234-user-name/
    RewriteRule ^member\-([0-9]+)\-([^/]+)/?$ view_profile.php?id=$1 [L,NC]
    

    L mean last rule, so if the regular expression is match, it will stop there.

    NC mean non case so capital letters like ABC are treated the same as lowercase like abc.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥30 雷达辐射源信号参考模型
  • ¥15 html+css+js如何实现这样子的效果?
  • ¥15 STM32单片机自主设计
  • ¥15 如何在node.js中或者java中给wav格式的音频编码成sil格式呢
  • ¥15 不小心不正规的开发公司导致不给我们y码,
  • ¥15 我的代码无法在vc++中运行呀,错误很多
  • ¥50 求一个win系统下运行的可自动抓取arm64架构deb安装包和其依赖包的软件。
  • ¥60 fail to initialize keyboard hotkeys through kernel.0000000000
  • ¥30 ppOCRLabel导出识别结果失败
  • ¥15 Centos7 / PETGEM