How to check the address bar?

Work in yii2 Home has two addresses www.site.ru and www.site.ru/web the second is when you go to the main home();

Because of this, there are problems with the links. How to check the address bar to /web/ ?
July 5th 19 at 00:10
2 answers
July 5th 19 at 00:12
Do the redirect/rewrite addresses server /web/ root and not have this problem.
July 5th 19 at 00:14
Good evening.
First .htaccess in the root
<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>


The second in the web directory
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

#RewriteCond %{REQUEST_URI} ^/web/*
RewriteRule . index.php

That is, if the site lies at the root of the server.
If in subdirectory, then config/web.php add to section components
'request' => [
 'baseUrl' => '/name_folder'
 ],
Now how to connect? - mateo_Polli commented on July 5th 19 at 00:17
: Depending on how they are connected - Dion77 commented on July 5th 19 at 00:20
: urlManager to set - Dion77 commented on July 5th 19 at 00:23

Find more questions by tags PHPYii