关于Yii2.0的url路径优化问题(配置虚拟路径)

2021-07-01 12:04

阅读:335

标签:url   rect   tee   路径   style   yml   show   问题   htaccess   

backend/config/main.php

‘urlManager‘ => [

    ‘enablePrettyUrl‘ => true,
    ‘showScriptName‘ => false, 
    ‘enableStrictParsing‘ => false,
    ‘suffix‘ => ‘.html‘,
        ‘rules‘ => [
            /‘ => ‘/view‘,
        ],
],

如果在web文件夹下增加一个.htaccess文件,配置如下:

Options +FollowSymLinks 

IndexIgnore */* 

RewriteEngine on  
# if a directory or a file exists, use it directly 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
 
RewriteRule . index.php

 

关于Yii2.0的url路径优化问题(配置虚拟路径)

标签:url   rect   tee   路径   style   yml   show   问题   htaccess   

原文地址:http://www.cnblogs.com/lucky-man/p/7133404.html


评论


亲,登录后才可以留言!