Restrict paths.pl

From EPrints Documentation
Revision as of 10:10, 18 July 2024 by Drn@ecs.soton.ac.uk (talk | contribs) (Added restrict_paths page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects


Back to cfg.d

restrict_paths.pl - Restrict paths is intended to allow certain IP addresses or subnets from being forbidden (i.e. 403 HTTP error code) from making requests to certain paths. This is useful if you want to block a bot from accessing processor-intensive pages but don't want to block it outright as that may stop it usefully indexing your EPrints repository.

Example

$c->{restrict_paths} = [
   # Prevent access to exportview from 1.2.3.4 and 5.6.7.8
   {
       path => '/cgi/exportview/',
       ips => [ '1.2.3.4', '5.6.7.8' ],
   },
   # Prevent access to export from 9.10.11.0/24 subnet
   {
       path => '/cgi/export/',
       ips => [ '9.10.11.' ],
   },
];