Yii url规则重写
2014-07-01 23:31
507 查看
1.配置config/man.php文件
'urlManager'=>array(
'urlFormat'=>'path',
'urlSuffix'=>'.html',
'showScriptName'=>false, // 这一步是将代码里链接的index.php隐藏掉。
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
2.开启apache mod_rewrite模块
3.在index.php同级模块建立
.htaccess
<IfModule rewrite_module>
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
</IfModule>
'urlManager'=>array(
'urlFormat'=>'path',
'urlSuffix'=>'.html',
'showScriptName'=>false, // 这一步是将代码里链接的index.php隐藏掉。
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
2.开启apache mod_rewrite模块
3.在index.php同级模块建立
.htaccess
<IfModule rewrite_module>
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
</IfModule>
相关文章推荐
- YII的重写规则与URL的管理
- YII的重写规则与URL的管理
- YII的重写规则与URL的管理
- Yii的重写规则与URL的管理
- apache url 重写规则
- Intelligencia.UrlRewriter.dll重写URL的规则例子
- yii2 url 重写 自定义url
- Thinkphp的URL规则,伪静态,路由,重写,伪静态,生成及其调试
- IIS web.config url重写伪静态规则错误
- YII重写URL
- iis7配置zend framework的地址重写规则[url_rewrite]
- 在Yii中重写URL(高级版)
- A Script Pro nginx URL重写规则无法播放MP4解决方法
- ZENCART Ultimate SEO URLs重写规则产品页URL
- 在Yii中重写URL(高级版)
- yii框架中分页url重写rewrite达到各参数变伪静态链接,即不出现?和&的参数
- URL Rewrite Rule重写规则
- UrlRewriter.dll重写URL的规则
- 利用apache的mod_rewrite做URL规则重写
- ThinkPHP重写规则优化URL及Rewrite规则详细说明