Posted on 28 Dec 2016
RT. Yii2.0 basic 如何配置apache的.htaccess
-
根目录下
RewriteEngine on RewriteRule ^$ web/ # if a directory or a file exists, use it directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # otherwise forward it to index.php RewriteRule ^(.*)$ web/$1
-
web目录下
RewriteEngine on # If a directory or a file exists, use it directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # Otherwise forward it to index.php RewriteRule . index.php