Ad

Precedence Of X-Robots-Tag HTTP Header Vs Robots.txt

- 1 answer

For example, if this is set in Apache settings:

<IfModule mod_headers.c>
    Header set X-Robots-Tag "noindex, nofollow"
</IfModule>

and this is set in a robots.txt file:

User-agent: *
Allow: /

which one will take precedence?

Ad

Answer

These are different instructions and so your query is void. Here the robots.txt file is allowing the crawling and the x-robots-tag is controlling the indexing.

Though if you had shown something which had the same directives but in different formats, then it would be the case that (for googlebot at least) the most restrictive would be noted.

Ad
source: stackoverflow.com
Ad