eZ Publish - LiteSpeed - Conditional header

I have an eZ Publish site, running in host access mode, with three subdomains, admin, mobile and down.

I don’t want the subdomains to be indexed by search engines, and I especially want to keep the admin interface out of the search engines.

Somehow, the admin interface got into Google. I updated the robots.txt file, but that only prevents further scans, it won’t cause pages to be removed (http://support.google.com/webmasters/bin/answer.py?hl=en&answer=156449).

To prevent the subdomains from being listed in Google search results, I tried to use these directives on a LiteSpeed server:

SetEnvIfNoCase Host ^(admin|mobile|down).*$ NO_INDEX=true
Header set X-Robots-Tag "noindex" env=NO_INDEX

It seems that the conditional always evaluates to true (or is ignored).

In that case, placing the Header directive in a VirtualHost section would be the best approach, but I don’t have access to the server configuration. I sent a ticket in to the hosting company, but they’re really busy. That’s a nice way of saying they didn’t fix it quickly.

One of the nicest features of eZ is its robust configuration, which includes HTTP headers. Adding these settings in siteaccess/admin/site.ini.append.php worked.

[HTTPHeaderSettings]
CustomHeader=enabled
OnlyForAnonymous=enabled
HeaderList[]=X-Robots-Tag
X-Robots-Tag[]
X-Robots-Tag[/]=noindex, nofollow

To remove the admin interface from Google, I’ll send them a request, just to be sure.