我想创建一个这样的网址:http: //domain.com/index.php/hir/2015-02-12/news_title
这是我的 urlmanager 什么不起作用:
'urlManager'=>array(
'urlFormat'=>'path',
'rules'=>array(
'hir/<date:\d+>/<title:\w+>'=>'news/view',
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
这是我的.htaccess:
Options +FollowSymLinks
IndexIgnore */*
<IfModule mod_rewrite.c>
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
</IfModule>
RewriteEngine on