robots.txt in Laravel

18,622

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.

Share:
18,622
rolfo85
Author by

rolfo85

Updated on June 13, 2022

Comments

  • rolfo85
    rolfo85 over 1 year

    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 ?

  • Trisno Raynaldy
    Trisno Raynaldy about 4 years
    Bruh, is it ok to let it being accessable from the site/browser?
  • Kat Lim Ruiz
    Kat Lim Ruiz about 2 years
    yes. robots.txt should be public
  • Marko
    Marko over 1 year
    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.