This plugin restricts the access of the anonymous user to a specified list of requests. The allowed requests can be specified in two different forms:
- as a query string that must be contained in the URL of the request
(
allowed_requests[]
array); - as a query string that must be contained in the http
Referer
header of the request (allowed_referrers[]
array);
The order in which he different parameters are specified in the query string is irrelevant.
The specified options are considered with OR logic, so it only needs one condition to be met to allow the request.
Optionally the anonymous user can be redirected to a custom URL.
Note that the following query strings are always allowed:
allowed_requests[] = "module=Login"
allowed_requests[] = "module=Proxy&action=getCss"
allowed_requests[] = "module=Proxy&action=getCoreJs"
allowed_requests[] = "module=Proxy&action=getNonCoreJs"
Refer to this Matamo FAQ.
Add the following section to your config.ini.php
according to your needs:
[RestrictAnonymousAccess]
allowed_requests[] = "module=Module¶m=value"
allowed_requests[] = "module=OtherModule"
allowed_referrers[] = "module=Module&action=action¶m=value"
; uncomment to redirect the user instead of displaying an error page, only for non-API requests
;redirect_unallowed_to = <URL>