Google's Gary Illyes has changed the way robots.txt files are placed

Article image Google's Gary Illyes has changed the way robots.txt files are placed
Article image Google's Gary Illyes has changed the way robots.txt files are placed
Publication date:10.11.2025
Blog category: SEO and Promotion

Gary Illyes, a Google analyst, in his message on LinkedIn, challenged the long-standing myth about the need to place the robots.txt file in the root directory of the site (for example, example.com/robots.txt). He explained that this is not a mandatory requirement and revealed a lesser-known feature of the Robot Exclusion Protocol (REP).

"The robots.txt file does not have to be in the root directory (example.com/robots.txt)."

Gary Illyes explains that it is acceptable to have two separate robots.txt files hosted on different domains - one on the main website and one on the content delivery network (CDN). In this way, websites can centralize their robots.txt file on a CDN while still controlling the indexing of their main page. 🚀

  • 📌 For example, a website might have two robots.txt files: one at https://cdn.example.com/robots.txt and one at https://www.example.com/robots.txt.
  • 📌 This allows them to maintain a single, comprehensive robots.txt file on their CDN and redirect requests from their main domain to this centralized file.
  • 📌 Illyes notes that RFC9309-compliant indexers will follow the redirect and use the target file as the robotstxt file for the originating domain.

🔍 Can I have two robots.txt files on different domains?

Yes, you can have two robots.txt files, one on your main website and one on your CDN.

🔍 Can I centralize my robots.txt file on a CDN?

Yes, you can centralize your robots.txt file on a CDN while still controlling the indexing of your main page.

🔍 Will crawlers follow my robots.txt redirect?

Yes, RFC9309-compliant indexers will follow the redirect and use the target file as the robotstxt file for the originating domain.

🧩 Summary: Google's Gary Illyes comments on the possibility of placing robots.txt files outside of the root directory can significantly change the practice of SEO. This allows websites to manage their indexing settings more flexibly, especially for sites with complex architectures or those using multiple subdomains and CDNs.
🧠 Own considerations: This new perspective on robots.txt placement may be useful for websites that heavily use CDNs to deliver content. Using a centralized robots.txt file can make it easier to manage site indexing and reduce the risk of conflicting directives between the main site and the CDN. However, it's important to remember that this approach will require webmasters to take a more careful approach to managing their robots.txt files, especially when there are different configuration options.

Comments

PixelHeart Avatar
за адресою https://www.example.com/robots.txt. Це звучить як чудовий план для тих, хто хоче мати контроль над своєю індексацією без зайвого клопоту! 🌟 Ніколи не думав, що тема robots.txt може бути такою цікавою! Дякую, Gary, за те, що ставиш все на свої місця і нагадуєш нам, що інколи правила – це більше рекомендації! 😄 Чи є у когось ще ідеї, як використовувати цю новину на свою користь? Давайте обговоримо!
10.11.2025 08:00 PixelHeart