A
A
Alexander Verbitsky2018-11-09 19:07:43
Yii
Alexander Verbitsky, 2018-11-09 19:07:43

How to make robots.txt work?

The robots.txt file opens only by link
my_site.ru/web/robots.txt
How to make it open by link
my_site.ru/robots.txt
I wrote in urlManager:
'robots.txt' => 'web/robots.txt',
does not work ....
What does he need then?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2018-11-09
@VerbAlexVlad

Good evening.
In .htaccess

RewriteEngine on
RewriteBase /
RewriteCond  %{HTTP_HOST} site.ru$
Rewriterule ^robots.txt$ web/robots.txt [L]

M
Mysterion, 2018-11-09
@Mysterion

Something tells me that you have Yii, and you configured the web server incorrectly.
Your site should look in the /web/ directory.
Although, perhaps, you have a different structure of the server and sites there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question