<body>
回复内容:
<body>
yii2的路由不是这样访问的。。。
要访问frontend\controllers\SiteController
正确的url应该是xxx.com/index.php/site
或xxx.com/site
而不是xxx.com/frontend/web/site
至于为什么xxx.com/index.php
能直接访问到project/frontend/web/index.php
,这是要给你的nginx/apache写路由重写规则来实现的。
你需要在web目录加个.htaccess文件
<code class="htaccess">Options +FollowSymLinksIndexIgnore /RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . inde<a style="color:transparent">、本文来源gao($daima.com搞@代@#码$网</a><big>搞gaodaima代码</big>x.php</code>