4

I would like to allow a path and disallow everything else in the directory.

User-Agent: *
Allow: /example/
Disallow: /example/*

Will this work? If not what would be a better way of doing this?

Stephen Ostermiller
  • 99,822
  • 18
  • 143
  • 364
Yaseen
  • 81
  • 3

1 Answers1

4

I actually found this helpful.

https://moz.com/community/q/robots-txt-how-to-exclude-sub-directories-correctly

User-Agent: *
allow: /example/$
disallow: /example/*
Maximillian Laumeister
  • 16,461
  • 3
  • 32
  • 63
Yaseen
  • 81
  • 3