Phpstudy
YII 2.0.7
下载YII 2.0.7,并安装。这里不详细说明安装方式。安装好了就以下文件
配置config文件,在网站目录下 common\config 目录下main.php文件内'components' => [ ] 数组内增加以下内容'urlManager' => [ 'enablePrettyUrl' => true, //true 开户伪URL重写 false 关闭 'showScriptName' => false, //'suffix' => '', //后缀.html 要设置请把//去除 对应后缀自己填写 .html或.htm或者不填 'rules' => [ '
找到前台网站的\frontend\web目录新建.htaccess文件[注意没有文件名,空的文件名'.htaccess'] 有些电脑不能新建的话可以网上下载一个去改。内容为:AddDefaultCharset utf-8Options +FollowSymLinksIndexIgnore */*RewriteEngine on# if a directory or a file exists, use it directlyRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-d# otherwise forward it to index.phpRewriteRule . index.php
后台 如果要设置的话就copy刚刚的.htaccess文件到\backend\web文件夹下。
.htaccess 文件下载不了请到网上下载