E
E
EVOSandru62017-04-21 19:46:21
Yii
EVOSandru6, 2017-04-21 19:46:21

The web folder in basic - how to remove if not UrlManager and not .htaccess?

Good afternoon,
Such a problem,
There is a project, when it was lying on a server, it had one .htaccess at the root:

AddDefaultCharset utf-8
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
RewriteCond %{HTTPS} != on
RewriteRule ^/?(.*) https://%poddomen.domen.com/$1 [R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php

The project is fully working on hosting.
I downloaded it locally, nothing worked with these settings, I tried it as in the documentation,
.htaccess in the root of the site:
AddDefaultCharset utf-8
<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>

And another .htaccess in the web folder :
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php

The site has opened. I went through authorization according to the access data, got into the admin module, and there in the address bar - url :
domen.loc/web/admin
Where could this web come from? If I delete it from the address bar and press ENTER , then again I get to the same url from web .
In this admin there are various links with domain.loc/admin/controller similar addresses. But when I go through them, I always end up in:
domain.loc/web/admin
In config/web.php :
...
'urlManager' => [
      'showScriptName' => false,
      'enablePrettyUrl' => true,
      'rules' => [
                '<controller>/<action>' => '<controller>/<action>',
        '<module:admin>/<action:\w+>'   =>  '<module>/default/<action>',
        'lk' => 'user/default/cabinet',
        'profile' => 'user/default/profile',
        'files' => 'user/default/files',
        'files/view' => '/user/default/view_file'
      ]
    ],
    ...

Please tell me, the masters - for what reason can I have this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-04-21
@EVOSandru6

There is an input script index.php it lies in the web folder, that's where it came from.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question