It works well in my lohalhost, when i try to put on the server this error occured.
In index.php
<?php defined('YII_DEBUG') or define('YII_DEBUG', true); defined('YII_ENV') or define('YII_ENV', 'dev'); require(__DIR__ . '/_protected/vendor/autoload.php'); require(__DIR__ . '/_protected/vendor/yiisoft/yii2/Yii.php'); require(__DIR__ . '/_protected/common/config/bootstrap.php'); require(__DIR__ . '/_protected/frontend/config/bootstrap.php'); $config = yii\helpers\ArrayHelper::merge( require(__DIR__ . '/_protected/common/config/main.php'), require(__DIR__ . '/_protected/common/config/main-local.php'), require(__DIR__ . '/_protected/frontend/config/main.php'), require(__DIR__ . '/_protected/frontend/config/main-local.php') ); $application = new yii\web\Application($config); $application->run(); .htaccess
RewriteEngine on # hide files and folders RedirectMatch 404 /_protected RedirectMatch 404 /\.git RedirectMatch 404 /composer\. RedirectMatch 404 /.bowerrc # If a directory or a file exists, use the request directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # Otherwise forward the request to index.php RewriteRule . index.php https://stackoverflow.com/questions/66828499/yii2-advanced-index-php-not-working-in-main-domain-the-code-in-index-php-shows March 27, 2021 at 02:08PM
没有评论:
发表评论