Answer the question
In order to leave comments, you need to log in
Yii2 how to configure htaccess?
Suppose I have a free hosting and I need to transfer from yii2basic to yii2basic/web
here is the following config
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
</IfModule>
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_URI} ^/.*
RewriteRule ^(.*)$ yii2basic/web/$1 [L]
RewriteCond %{REQUEST_URI} !^/yii2basic/web/
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ yii2basic/web/index.php
</IfModule>
Answer the question
In order to leave comments, you need to log in
Good evening.
At the root of the site .htaccess
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine on
</IfModule>
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_URI} ^/.*
RewriteRule ^(.*)$ web/$1 [L]
RewriteCond %{REQUEST_URI} !^/web/
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ web/index.php
</IfModule>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
'baseUrl' => '/yii2basic'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question