Answer the question
In order to leave comments, you need to log in
How to set normal URLs in .php files of a Yii project?
server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster.
error 500
<IfModule mod_autoindex.c>
Options -Indexes
</IfModule>
<IfModule mod_rewrite.c>
Options +FollowSymlink
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /web/index.php
</IfModule>
Answer the question
In order to leave comments, you need to log in
Good afternoon.
What exactly do you want to do?
Remove "web" from address bar?
If so, then it's done a little differently.
You need two .htaccess
The first one should be put in the "web" directory
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} ^/web/*
RewriteRule . index.php
<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>
return [
'components' =>[
'urlManager' => [
// настройки urlManager
]
]
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question