SPUEdit
SPUEdit is a rarely used directive that allows EZproxy administrators fine-grained control over the starting point URL to which users are directed.
SPUEdit is a position-dependent, repeatable config.txt directive that interacts with AutoLoginIP, ExcludeIP, IncludeIP, and other SPUEdit directives. SPUEdit directs EZproxy to edit starting point URLs using regular expressions to allow URLs to be rearranged and then users to be rerouted to the rearranged URLs.
Qualifiers
Qualifier | Description |
---|---|
/ | Any non-alphabetic, non-digit character |
find | A Perl-style regular expression to match |
replace |
The string to use to replace the expression in find. This string may contain variables including:
|
girs |
An optional combination of letters used to indicate that:
|
For SPUEdit to be effective, the final rule must include the redirection option (r).
Syntax
SPUEdit / find/ replace/ girs
Examples
The following example shows how to remap URLs that point to http://web.somedb.com and make them point to http://www.somedb.com instead:
SPUEdit @^http://web\.somedb\.com/(.*)$@http://ezproxy.yourlib.org:2048/login?url=http://www.somedb.com/$1@ir
Note the use of @ instead of / between the find, replace, and options. If / had been used, each of the slashes that appear in the find and replace strings would need to be specified using \/ instead of just /.
Logging SPUEdit
While developing SPUEdit directives, you can add:
Option LogSPUEdit
to config.txt to direct EZproxy to record the SPUEdit manipulations of starting point URLs to messages.txt.
Varying rules based on type of IP access
An SPUEdit directive can be set to apply only if the user's IP address falls within a current AutoLoginIP, ExcludeIP, and/or IncludeIP range. To select when a rule applies, use one of:
SPUEdit -AutoLoginIP ...
SPUEdit -ExcludeIP ...
SPUEdit -IncludeIP ...
SPUEdit -AutoLoginIP -ExcludeIP ...
SPUEdit -AutoLoginIP -IncludeIP ...
SPUEdit -ExcludeIP -IncludeIP ...
In the absence of any of these qualifiers, the SPUEdit applies regardless of the type of source IP. These qualified lines are position-dependent, so they should be arranged in config.txt after relevant AutoLoginIP, ExcludeIP, and/or IncludeIP directives.
Related directives
AutoLoginIP, ExcludeIP, IncludeIP, Option LogSPUEdit, SPUEditVar