Mobile app version of vmapp.org
Login or Join
Sherry384

: X-Robot-tag noindex not appearing in header I am trying to include the following in my response header to all resources in multiple directories (dirone/dirtwo/dirthree/direfour) from an Apache server.

@Sherry384

Posted in: #Apache #Linux

I am trying to include the following in my response header to all resources in multiple directories (dirone/dirtwo/dirthree/direfour) from an Apache server.

X-Robots-Tag: noindex, nofollow


In my httpd.conf file I have added the setting to the dirone underneath my main directory declaration.

It is not producing the additional item in the response header. Do you see what I am doing wrong?

<Directory />
Options FollowSymLinks Includes
AllowOverride None
</Directory>

<Directory "/web/sitename/docs/dirone">
Header set X-Robots-Tag "noindex, nofollow"
</Directory>


Additional information. I am moving away from the robots.txt approach, we do not use .htaccess files and I want the header in all resources in those directories and their sub-directories to have X-Robots-Tag: noindex, nofollow in them as well.

Thanks for your help.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Sherry384

1 Comments

Sorted by latest first Latest Oldest Best

 

@Heady270

I think the problem is that the Header directive shouldn't go in a Directory section. Instead it should go with the other configuration for sitename and use a Files directive.

So in your sitename configuration (even in your .htaccess) you should use:

<Files "dirone/*">
Header set X-Robots-Tag "noindex, nofollow"
</Files>

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme