Context Types
The extension provides several built-in context types. Each type evaluates different conditions to determine if a context is active.
On this page
IP Address Context
Match visitors by their IP address or IP range. Supports both IPv4 and IPv6.
Configuration
-
- type
-
string
- required
-
true
Single IP address, CIDR notation, range, or comma-separated list.
Examples:
- Single IP:
192.168. 1. 100 - CIDR notation:
10.,0. 0. 0/ 8 FE80::/16 - Range:
192.168. 1. 1- 192. 168. 1. 255 - Wildcards:
80.,76. 201.* 80.76.*. 37 - Multiple:
192.168. 1. 0/ 24,10. 0. 0. 0/ 8
Use Cases
- Internal network detection (show admin tools for office IPs)
- Geographic content (by IP geolocation with
contexts_)geolocation - Office vs. external visitor differentiation
- Development/staging environment detection
Domain Context
Match based on the accessed domain name (HTTP_HOST).
Configuration
-
- type
-
string
- required
-
true
Domain name(s) to match. One domain per line.
Matching Rules:
-
Without leading dot: Exact match only
www.will not matchexample. org example.org
-
With leading dot: Matches all subdomains
.example.matchesorg www.,example. org shop., etc.example. org
Examples:
- Single:
www.example. com -
Multiple (one per line):
example.com www.example.comCopied! - Subdomain wildcard:
.example.com
Use Cases
- Multi-domain setups (different content per domain)
- Staging vs. production detection
- Brand-specific content on shared installations
- Language-specific domains
Query Parameter Context
Match based on URL query parameters (GET parameters).
Configuration
-
- type
-
string
- required
-
true
The GET parameter name to check.
-
- type
-
string
- required
-
false
Value to match. Supports regular expressions. If empty, any non-empty value activates the context.
-
- type
-
boolean
- default
-
true
When enabled, the context state is stored in the user session, persisting across page navigations even after the parameter is removed from the URL.
Examples:
?debug=1with parameterdebugand value1?variant=afor A/B testing?afffor affiliate trackingID=partner
Use Cases
- A/B testing variants
- Debug mode activation
- Campaign and affiliate tracking
- Feature flags via URL
HTTP Header Context
New in version 3.0.0
HTTP Header context for matching request headers.
Match based on HTTP request headers sent by the browser or proxy.
Configuration
-
- type
-
string
- required
-
true
The HTTP header name to check (case-insensitive).
-
- type
-
string
- required
-
false
Value(s) to match against the header. One value per line. Matching uses case-insensitive substring comparison: if any configured value appears anywhere in the actual header value, the context matches. If empty, any non-empty header value activates the context.
-
- type
-
boolean
- default
-
true
Has no effect for this context type. The header is evaluated on every request, so the context is active only on requests that carry a matching header.
New in version 4.0.0
PSR-7 header support and case-insensitive substring matching.
Header Name Resolution
The extension supports both standard HTTP header names and
$_ parameter keys:
- PSR-7 header names (recommended):
User-,Agent Accept-,Language X-Forwarded- For - $_SERVER keys (legacy):
HTTP_,USER_ AGENT HTTP_ACCEPT_ LANGUAGE
The lookup order is:
- PSR-7
$request->get(standard header name)Header Line () $request->get(Server Params () $_key format)SERVER
Value Matching
Values are matched using case-insensitive substring comparison.
For example, with header User- and configured values:
Mobile
Android
iPhone
A User-Agent string like Mozilla/
matches because it contains i (case-insensitive).
Examples:
X-for proxy detectionForwarded- For Accept-for language preferencesLanguage User-for browser/device detectionAgent - Custom headers from CDN or load balancer
Use Cases
- CDN or proxy detection (
X-,Forwarded- For CF-)Connecting- IP - Mobile device detection via
User-Agent - Accept-Language based content
- Custom application headers
- Bot detection; for AI crawlers use the AI crawler context
AI crawler context
Matches requests whose User- header names a known AI crawler or AI
fetcher. Editors select the type and need no user-agent strings; the list of
crawlers ships with the extension. Use the context like any other, for
example to show or hide pages and content elements.
Configuration
-
- type
-
string
- required
-
false
Further substrings, one per line, for crawlers that are not on the built-in list. Matching is the same as for the HTTP header context: case-insensitive substring comparison against the
User-header.Agent
-
- type
-
boolean
- default
-
true
Has no effect for this context type. The header is evaluated on every request.
Built-in user agents
Each entry is the name its vendor documents for its crawler or fetcher. OpenAI and Perplexity publish the full user-agent strings; Anthropic publishes the bot names. Last checked against the sources on 2026-11-06.
| User agent | Vendor's stated purpose | Source |
|---|---|---|
GPTBot | Crawls content that may be used to train OpenAI's foundation models | OpenAI crawlers |
OAI- | Indexes sites for ChatGPT search | OpenAI crawlers |
Chat | Visits a page for a user action in ChatGPT | OpenAI crawlers |
Claude | Collects content that may be used to train Anthropic's models | Anthropic crawlers |
Claude- | Indexes content to improve search answers | Anthropic crawlers |
Claude- | Fetches a page when a user asks Claude a question | Anthropic crawlers |
Perplexity | Surfaces and links websites in Perplexity search results | Perplexity crawlers |
Perplexity- | Visits a page when a user asks Perplexity a question | Perplexity crawlers |
Not on the list:
Google-is a robots.txt product token only. Google states that it has no separate HTTP user-agent string, so it cannot be detected in a request.Extended anthropic-does not appear in Anthropic's documentation.ai OAI-checks the landing pages of ChatGPT ads; it does not read content for training, search or users.Ads Bot
Extending the list
Integrators add user agents for all AI crawler contexts of an installation
in config/system/additional.php or an extension's
ext_localconf.php:
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['contexts']['aiCrawlerUserAgents'][] = 'ExampleAiBot';
Entries that are not non-empty strings are ignored. To add a user agent for one context only, use Additional user-agent substrings.
Warning
The User- header is set by the client. The context detects what
a client claims to be and does not verify it: a browser can send
GPTBot and a crawler can send a browser user agent. Do not use the
context to protect content.
Session Context
Match based on frontend user session data.
Configuration
-
- type
-
string
- required
-
true
Key in the session data to check.
-
- type
-
string
- required
-
false
Value to match. If empty, checks if the key exists and is not NULL.
Use Cases
- User state tracking
- Shopping cart state (cart has items)
- Login/authentication state
- Multi-step form progress
- User preference flags
Combination Context
Combine multiple contexts with logical operators for complex rules.
Configuration
-
- type
-
string
- required
-
true
Logical expression combining context aliases.
Operators:
&&- logical AND (all must match)|- logical OR (any must match)| !- negation (must NOT match)(...)- parentheses for grouping
Examples:
mobile && !tablet- Mobile but not tabletinternal- Internal network or admin user| | admin (german- German-speaking non-guest| | austrian) && !guest campaign_- Campaign A visitors who haven't converteda && !already_ converted
Use Cases
- Complex multi-condition business rules
- Nested context hierarchies
- Exclusion rules (show to A but not if B)
- Compound targeting (A AND B OR C)
Tip
Use descriptive context aliases to make combination expressions readable.
For example: premium_