|
User-agent: * Disallow: /blog/ Allow: /blog In this case, the URL /blog/post-title/ looks like it's forbidden, but it also looks like it's allowed. So which one takes priority? For Google and Bing, the rule is to prioritize directives with the most characters. This is the Disallow directive. Disallow: /blog/ (6 characters) Allow: /blog (5 characters) If Allow and Disallow directives are of equal length, the least restrictive directive takes precedence. In this case it would be the Allow directive. Note : Here it is accessible and crawlable /blog ( even without the trailing slash ).
Importantly, this only applies to Google and Bing . Other search engines follow the first matching directive. In this case, it will be Disallow. Sitemap Australia Phone Number Data Use this directive to tell search engines where your sitemap is located. If you're not familiar with sitemaps, they typically contain pages that search engines crawl and index. Below is an example robots.txt file using the sitemap directive. Sitemap:User-agent: * Disallow: /blog/ Allow: /blog/post-title/ How important is it to include a sitemap in the robots.txt file? If you're already submitting through Search Console, it's a bit redundant for Google. However, it's still a good practice because it tells other search engines, such as Bing, where your sitemap is located.
Note that there is no need to repeat sitemap directives multiple times for each user agent. It doesn't just apply to one or the other. Therefore, we recommend that you include a sitemap directive at the beginning or end of your robots.txt file. for example: Sitemap:User-agent: Googlebot Disallow: /blog/ Allow: /blog/post-title/ User-agent: Bingbot Disallow: /services/ Google supports sitemap directives, as do Ask, Bing, and Yahoo .
|
|