网站标题logo怎么做的,网站seo检测报告,白宫 wordpress,安卓app开发多少钱网上大部分都是普通的开启和配置资料 按照网上资料配置 访问localhost/index/php?rgii 总是提示404错误 解决方法如下#xff1a; Yii基础版中的 web.php 代码如下 if (YII_ENV_DEV) {// configuration adjustments for dev environment$config[bootstrap][] debug;$config…网上大部分都是普通的开启和配置资料 按照网上资料配置 访问localhost/index/php?rgii 总是提示404错误 解决方法如下 Yii基础版中的 web.php 代码如下 if (YII_ENV_DEV) {// configuration adjustments for dev environment$config[bootstrap][] debug;$config[modules][debug] [class yii\debug\Module,// uncomment the following to add your IP if you are not connecting from localhost.//allowedIPs [127.0.0.1, ::1],];$config[bootstrap][] gii;$config[modules][gii] [class yii\gii\Module,// uncomment the following to add your IP if you are not connecting from localhost.allowedIPs [127.0.0.1, ::1],];
} 注意这里的变量是YII_ENV_DEV 而在入口文件index.php中配置的是 defined(YII_DEBUG) or define(YII_DEBUG, true);
defined(YII_ENV) or define(YII_ENV,dev);
//需要根绝web.php中的变量YII_ENV_DEV增加对应的开启设置
defined(YII_ENV_DEV ) or define(YII_ENV_DEV , true);require(__DIR__ . /../vendor/autoload.php);
require(__DIR__ . /../vendor/yiisoft/yii2/Yii.php);$config require(__DIR__ . /../config/web.php);(new yii\web\Application($config))-run(); 2.路由配置 enablePrettyUrl 设置为false //路由配置urlManager [enablePrettyUrl false,//路由的路径化 去掉 ?rshowScriptName false,//隐藏入口Index.php文件//suffix .html,//假后缀(fake suffix) .htmlrules [controller:\w/name:\w/action:\wcontroller/action,company/id:\d.htmlcompany/list,],], 3.GII是基于本地访问使用的 所有使用localhost或127.0.0.1来访问。转载于:https://www.cnblogs.com/liangzia/p/10882783.html