6

I just was wondering if the robots.txt file is supposed to work like general robots txt files. So, you type for example "disallow/admin/*" place it into the the root Laravel folder and that's it.

Is it like this ?

rolfo85
  • 717
  • 3
  • 11
  • 27

2 Answers2

18

Remember, that website address is relevant to public dir. So, if you want robots.txt to work in Laravel, it must be placed in the public folder.

Rik
  • 3,647
  • 2
  • 25
  • 34
Michał G
  • 2,234
  • 19
  • 27
0

robots.txt is a special file used by search bots to read and crawl the website resources.

robots.txt should be at the root of the website.

The root directory differs from OS to OS. I am giving a few of them. Better that you consult with your server admin.

Example:

/public_html
/htdocs
/html
w5m
  • 2,286
  • 3
  • 34
  • 46
Bikram Pahi
  • 1,107
  • 1
  • 12
  • 33
  • The OP asked about robots.txt specifically in a Laravel application. Your answer does not address the OP's question in any relative or meaningful way as the OP didn't ask WHAT a robots.txt file is, nor did the OP ask where you would place a traditional robots.txt file. In a Laravel app, the web entry point is at /public in the index.php file as pointed out by Michal G above. – Mark C. Feb 20 '22 at 06:33