Home >Backend Development >PHP Tutorial >Yii框架如何配置Restful?

Yii框架如何配置Restful?

WBOY
WBOYOriginal
2016-06-06 20:20:041194browse

按照它的官网配置的教程:
http://www.yiiframework.com/doc-2.0/guide-rest-quick-start.html

  • 新建UserController

  • 配置config/web.php
    Yii框架如何配置Restful?

还要再作其它操作吗?现在的情况是,所有的网站都404

配置了 rules 之后,全站报500。。。我也是醉了。

回复内容:

按照它的官网配置的教程:
http://www.yiiframework.com/doc-2.0/guide-rest-quick-start.html

  • 新建UserController

  • 配置config/web.php
    Yii框架如何配置Restful?

还要再作其它操作吗?现在的情况是,所有的网站都404

配置了 rules 之后,全站报500。。。我也是醉了。

慢慢看文档,官方都是说明吧

.htaccess配了吗?需要放在web目录下

<code>RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php [L]</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn