thinkphp url重写,我想把模块隐藏掉只显示操作名

浏览:2608 发布日期:2016/07/18 分类:ThinkPHP5专区 关键字: url 路由隐藏模块名
thinkphp url重写,我想把模块隐藏掉只显示操作名比如localhost/index.php/Vip/vip 写成这样的localhost/vip 主要是.htaccess文件里不知怎么弄 谢谢了


下面这个规则只能去掉index.php,但是我要的是模块也去掉,就报错了,我的写法是:RewriteRule ^(.*)$ index.php/admin/$1 [QSA,PT,L],直接在index.php后面加一个貌似不行。求大神的指点一下.htaccess的写法啊。

<ifModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</ifModule>
url模式'URL_MODEL'=>2
最佳答案
评论( 相关
后面还有条评论,点击查看>>