在Yii2中,我不能启用漂亮的url。
我的配置:
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
],
我的.htaccess:
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FI
在文件.htaccess中,我使用了以下规则:
# enable URI rewrite
RewriteEngine On
# if request is for an actual file or directory on disk,
# then do not continue with rewrite engine
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^category/([^/]+)/([^/]+)/([^/]+)(?:/([^/]+))?/? ind