修改 URL 后无法访问 [ 新手入门 ]
把这段释放出来后,报错
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
],
],
地址是变了:http://localhost:3721/yii2test/frontend/web/site/about
但是报了下面的错误。
Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
If you think this is a server error, please contact the webmaster.
Error 404
localhost
Apache/2.4.4 (Win32) OpenSSL/1.0.1e PHP/5.5.1
共 5 条回复
-
配置文件应该没有问题
'components' => [ 'urlManager'=>[ 'enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => [ ], ], 'request' => [ // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation 'cookieValidationKey' => 'asdasd', ], 'cache' => [ 'class' => 'yii\caching\FileCache', ], 'user' => [ 'identityClass' => 'app\models\User', 'enableAutoLogin' => true, ], 'errorHandler' => [ 'errorAction' => 'site/error', ], ]
-
tiandi2050 回复于 2015-12-03 15:56 举报
'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'suffix' => ".html", 'rules' => [ ''=>'site/index', ['class' => 'yii\rest\UrlRule', 'controller' => ['site/index', 'memchant/index','mobile/custom','mobile/tiao','mobile/down','mobile/sure']], ] ]
这是我们配的一个 URL 伪静态规则
luoxuan
注册时间:2015-11-26
最后登录:2016-01-07
在线时长:5小时16分
最后登录:2016-01-07
在线时长:5小时16分
- 粉丝0
- 金钱130
- 威望0
- 积分180