我有这样的网址:
www.studyenglish/index.php?r=site/lesson&act=read&id=1
我希望更改为:
www.studyenglish/site/lesson/read
我在 url manager config/main.php 中添加了这个脚本
'urlManager'=>array(
....
'showScriptName'=>false,
....
),
并将此脚本添加到 .htaccess
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
# 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
但它只适用于这样的网址:
www.studyenglish/index.php?r=site/lesson
成为:
www.studyenglish/site/lesson
那么,如何更改此网址
www.studyenglish/index.php?r=site/lesson&act=read&id=1
成为
www.studyenglish/site/lesson/read
希望有人可以提供帮助。谢谢 ...