我是新来的。naybody知道如何缩小网址。例如:yourdmain.com/blog/view/blog-title我需要这个网址像这样:yourdmain.com/blog-title请解释如何做到这一点。 ..
在配置文件夹下使用route.php
$route['blog-title] = 'blog/view/blog-title';
如果您需要根据标题动态加载
$route['(:any)/index.html'] = 'blog/view/$1';
// will route any url with /index.html to your controller
$route['(:any).html'] = 'blog/view/$1';
// will route any url with title.html to your controller then pass your title as your function variable
为什么选择index.html或.html
这是我用来区分其他URL与博客标题url的方式,这意味着只有扩展名为index.html或.html的url才会被路由到我的Blog / view路径
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句