![thinkphp <wbr>缩短路径 thinkphp <wbr>缩短路径](https://i-blog.csdnimg.cn/blog_migrate/97624485bf6a57591742d0f38aca3098.jpeg)
首先修改apache配置文件:#LoadModule rewrite_module modules/mod_rewrite
去掉#打开伪静态
然后在与入口文件(index.php)同级目录下加文件'.htaccess'。文件内写入重写规则,去除index.php:
然后想继续缩短地址,则使用thinkphp的路由规则:如‘about/:id\d’=> 'Index/about'
http://langxi.com/Index/about/1.html将显示为:http://langxi.com/about/1.html
:代表动态,如动态会变的id,term_id等需要get获取的。\d代表整型