如何让我的codigniter网址seo友好。如何让我的codigniter网址seo友好
这是我的网址
http://localhost/picker2/web/search?category=doctor
我想网址这样
http://localhost/picker2/web/search/doctor/
如何让我的codigniter网址seo友好。如何让我的codigniter网址seo友好
这是我的网址
http://localhost/picker2/web/search?category=doctor
我想网址这样
http://localhost/picker2/web/search/doctor/
阅读这篇文章www.askaboutphp.com/58/codeigniter-mixing-segment-based-url-with-querystrings.html
像这样创建网址:http://heloo.com/article/codeigniter-based-url 添加此代码在routes.php
$route['article/(:any)'] = "article/readmore/$1";
描述:
其实你有两个选项
1)使用路线(这个已经denyptw讨论吧?)
2)使用的网址助手url_title功能
注意:您可以用它代替查询字符串
http://localhost/picker2/web/search?category=doctor
http://localhost/picker2/web/search/doctor/
网络参数控制器,搜索功能,医生参数
示例:
class Web extends CI_Controller
{
public function search($value)
{
//use this $value in your searching logic
}
}
你需要实例网址助手的
检查此链接Codeigniter URL: How to display id and article title in the URL
这已经被问了几次,我相信,如果你看看堆栈溢出,你会发现它。 – user4419336