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条)

报告相同问题?

悬赏问题

  • ¥15 BAPI接口中丢失数据: IF_VSTEL;对象类型 OutboundDelivery 没有被创建的实例. 外部参考:
  • ¥30 关于#java#的问题,请各位专家解答!
  • ¥30 vue+element根据数据循环生成多个table,如何实现最后一列 平均分 合并
  • ¥20 pcf8563时钟芯片不启振
  • ¥20 pip2.40更新pip2.43时报错
  • ¥15 换yum源但仍然用不了httpd
  • ¥50 C# 使用DEVMOD设置打印机首选项
  • ¥15 麒麟V10 arm安装gdal
  • ¥20 OPENVPN连接问题
  • ¥15 flask实现搜索框访问数据库