SegmentFault (www. sf. gg) is a leading developer technology community in China. We hope to provide programmers with a pure and high-quality technology exchange platform to learn, communicate and grow with developers and create an era for developers!
Reply content:
Https://github.com/yiisoft/yii2/blob/master/docs%2Fguide%2Fstart-installation.md#recommended-apache-configuration-
The route of yii2 is not accessed in this way...
To accessFrontend \ controllers \ SiteController
The correct url should beXxx.com/index.php/siteOrXxx.com/siteInsteadXxx.com/frontend/web/site
Why?Xxx.com/index.phpDirect accessProject/frontend/web/index. phpThis is to write routing Rewrite Rules for your nginx/apache.
Add a. htaccess file to the web directory.
Options + FollowSymLinksIndexIgnore/RewriteEngine onRewriteCond % {REQUEST_FILENAME }! -FRewriteCond % {REQUEST_FILENAME }! -DRewriteRule. index. php