NoIndexIf -- disallows indexing documents having a section matching a pattern.



NoIndexIf [Match | NoMatch] [Case | NoCase] [String | Regex] {SectionName} {Pattern...}


NoIndexIf is opposite to IndexIf.

NoIndexIf disallows indexing of documents having the section with name SectionName matching Pattern. Should typically be used in combination with IndexIf.

The first three optional parameters describe comparison type. The default values are Match, Case, String (case insensitive string pattern match with ? and * wildcards meaning one character and any number of characters correspondingly).

The SectionName parameter specifies which section is checked against Pattern. It can also be a concatenation of multiple sections, composed with help of ${SECTION} syntax.

It is possible to use multiple patterns in the same NoIndexIf command. In this case the command will be applied as soon as the first matching pattern is found.


NoIndexIf takes global effect for the entire configuration file and can be used multiple times.


# Don't index a document if its Body section contains "porno"
NoIndexIf Body *porno*
IndexIf Body *

See also

Index, IndexIf, Robots.