use*_*556 3 yii yii-extensions
我从https://github.com/travisstroud/yiiSkeletonApp下载了yiiSkeletonApp
设法localhost/dev工作,但当我点击登录/注册时,我收到错误404.
登录网址和注册网址是http://localhost/dev/login和http://localhost/dev/user/create
在我的protectd/config/main.php中我有这个..
'urlManager' => array(
'urlFormat' => 'path',
'showScriptName' => false,
'rules' => array(
'<controller:\w+>/<id:\d+>' => '<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
),
),
Run Code Online (Sandbox Code Playgroud)
这也是文件保护/视图/网站/ login.php中和保护/视图/用户/ create.php确实存在
这是错误消息
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
Run Code Online (Sandbox Code Playgroud)
文件夹内容:
localhost/dev/
- assets/
- css/
- images/
- protected/
- themes/
- yii/
- facebook-channel.php
- index.php
- index-test.php
- README.md
Run Code Online (Sandbox Code Playgroud)
您的网站配置为使用硬编码路径.所以它指的是错误的路径.
尝试从localhost访问此URL,
localhost/dev/index.php/site/login
localhost/dev/index.php/site/user/create
Run Code Online (Sandbox Code Playgroud)
urlManager没有问题.您可以参考此链接来了解yii的URL Manager.
http://www.yiiframework.com/doc/guide/1.1/en/topics.url