douyu5775 2014-06-20 06:47
浏览 51

从MySQL中的文件使URL SEO友好[重复]

This question already has an answer here:

I am trying to make my URLs SEO friendly. The current URLs example is http://example.com/details.php?recordID=35791

I would like it to display the 'Name Of Event' in the URL rather than 'details.php?recordID=35791' from a MYSQL database

I have renamed the title by using '?php echo $row_rsd1['Name Of Event'];' in the php page already so the tab is showing correct.

I have too many records to manually rename.

</div>
  • 写回答

1条回答 默认 最新

  • douzizang7783 2014-06-20 06:59
    关注

    You can make like it.

    www.example.com/event-detail-147854-group-meeting.php
    

    here 147854 is record ID and group meeting is title of event.

    you can convert title into lower case and spaces replacing by dashes.

    Then map in .htaccess file.

    RewriteRule ^event-detail-([0-9]+)-([a-zA-Z0-9_\-+]+).php event-detail.php?id=$1&title=$2
    
    评论

报告相同问题?

悬赏问题

  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题