How to set the path to robots.txt?

Yii2 basic robots.txt lies in the web at the address opens, but the search engines probably better off without /web/?
To write a redirect in htaccess or in the urlManager something?
I think sitemap.xml will be a similar situation?
June 14th 19 at 18:31
2 answers
June 14th 19 at 18:33
Thanks for the reply, but the redirect to the web folder in the project already configured - kimberly.Predovic commented on June 14th 19 at 18:36
that redirection?
in htaccess? it doesn't have to do htaccess, it should do Apache
see the recommendation from the documentation:

again — redirect to the web means that the server looks at the root, but the redirect — you do not need!

you need to redirect the server to look in the web folder! - Mohamed_Lind75 commented on June 14th 19 at 18:39
Yes , the redirect was made only in htaccess
On my hosting I have no access to httpd.conf(apache), so don't tell me - it will be enough to register?
DocumentRoot "/domains/"
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php

So I support not pulled constantly - kimberly.Predovic commented on June 14th 19 at 18:42
If there is no access to http.conf, then go to where to watch the server (public_html apparently) put the contents of the web folder and the remaining files placed on a higher level.
That is, move all files in /domains/ and the web folder into public_html. - Giles_Luettgen18 commented on June 14th 19 at 18:45
June 14th 19 at 18:35
You must configure the server so that the website looked in the web folder, not in root folder basic. Then Everything will work as expected

Find more questions by tags Yii