PHP CMS的SEO友好URL

时间:2017-12-08 15:22:49

标签: php url-rewriting content-management-system

用于PHP CMS的URL重写

主持:Godaddy Windows(.htaccess不起作用)

  1. 想要将网址www.domainname.in/category.php?ct=6重写为www.domainname.in/category/sports

  2. 想要将网址www.domainname.in/detail-news.php?p=70重写为www.domainname.in/detail-news/dummy-teams-wins-the-match

  3. ct = 6是运动 p = 70冠军是假队赢得比赛

1 个答案:

答案 0 :(得分:0)

您应该使用CMS表格中的slug字段,该字段将包含名称或标题 例如: 您的演示文稿中的文章是70: www.domainname.in/detail-news.php?p=70

然后slu the将是'dummy-teams-wins-the-match'保存到那篇文章中 当访问者输入此链接时, www.domainname.in/detail-news/dummy-teams-wins-the-match

系统的核心将检查数据库中是否存在该slug并将其重定向到包含slug'dummy-teams-wins-the-match'且id = 7的文章