I want to disallow a specific folder and all of its files and subdirectories but I don't know the difference between Disallow: /somedir/
and Disallow: /somedir/*
. which one of these lines should I use?
By the way, what does Disallow: /somedir?
mean? should I use it too?
According to google (https://developers.google.com/search/reference/robots_txt),
Disallow: /somedir/
and Disallow: /somedir/*
are equivalent, the trailing wildcard is ignored. Use whichever you like better.
The ?
does not have any special meaning in robots.txt like it does in some pattern matching schemes. Therefore, Disallow: /somedir?
means to disallow that literal path including the question mark.