Page tree
Skip to end of metadata
Go to start of metadata

In some situations it is required, or desirable, to modify the URL for an online resource. The most common situation where this occurs is when an institution offers a "proxy server" (aka "reverse proxies") which is used to proxy requests for e-resources in order that a user can access the e-resource with minimal authentication/authorisation issues (e.g. if the proxy server is granted IP authorisation to the resource, the user can access the resource from any location using the proxy server). For example a resource might have the URL: The proxied link for the same resource could be http://proxy.server.url/?url= 

Another common situation where modification to a URL is required, is where the e-resource provider requires an institutional code to be added to a URL before it will respond to any requests to the URL. For example an e-resource might have the URL:, but in order to successfully link to the resource using the subscription for a specific institution "ABCD" this URL would need to be modified to be: Major database vendors such as EBSCO and Gale support institution specific URLs of this type.

In order to support such modified URLs, the Agreements app offers a system of templating which can be used to both:

  • create Proxy server configurations, which modify all URLs across the system and;
  • create platform level URL customizations, which modify all the URLs on a specific platform

Proxy server configuration is done via Settings → Local KB Admin → Proxy server settings. Proxy server configurations will apply to all URLs in the internal Knowledgebase by default, but specific platforms can be excluded from the Proxy server configuration, or from the platform record (accessed via the Agreements app). You can create multiple proxy server configurations if there are multiple proxy servers used (e.g. where a separate proxy server is used for resources licensed to Alumni).

Platform level URL customizations can be added to the platform record (accessed via the Agreements app). Each platform can have a single URL customization. 

URL customizations and proxy server configurations generate additional URLs to the URLs already stored in the system for the e-resource. If there are proxy server configurations and platform level URL customizations set, any URLs generated by a platform URL customization will also have the proxy server configuration applied (but not the reverse - the platform URL customization is never applied after the proxy configuration). So for example if a URL such as was modified to by a platform URL customization, a proxy server configuration would produce the proxied version of the URL such as http://proxy.server.url/? In this case four URLs would be available for the e-resource in total:

Original URL:

Original URL proxied: http://proxy.server.url/?

Customized URL:

Customized URL proxied: http://proxy.server.url/?

If there are multiple proxy server configurations, each additional configuration will result in an additional version of the Original and Customized URL modified for that proxy

Writing proxy server configurations and URL customizers

The templating system for modifying URLs works in the same way for both proxy server configurations and URL customizers. The templates can be used to do one or more of the following as required:

  • Add text before the original URL
  • Add text after the original URL
  • Encode text with URL (aka 'percent') encoding
  • Remove any protocol prefix from a URL
  • Replace or remove text from the original URL
  • Add a "local platform code" to a URL as defined on the platform record

Any text that is to be added around the original URL (such as a proxy server prefix or suffix) can just be typed as plain text, while any variables or helpers (which are functions which can be used for more complex modifications) need to be inside double curly brackets {{ }}. 

The variables supported by the templates currently are `inputURL` and `platformLocalCode`:

  • The `inputURL` variable represents the URL to which the modifications specified in the template will apply and would usually appear in all templates
  • The `platformLocalCode` variable is the  (if any) for the platform where the resource is accessed. The local platform code is defined on the platform record in the Agreements application and would typically be used to store information such as a database code that needs to be added into a URL

The helpers supported by the templates currently are  `urlEncode`, `insertAfter`, `insertBefore`, `removeProtocol` and `replace` and are explained in detail below.

A simple addition of a prefix for a proxy server would be achieved using the following customization code:{{ inputUrl }}

and a suffix addition would be achieved with

{{ inputUrl }}?some-suffix-text

and adding both a prefix and suffix is{{ inputUrl }}?some-suffix-text

Helper functions can be used inside the curly brackets. These work as follows:


{{ urlEncode inputUrl }}

Explanation: This helper encodes a URL (or other string) using percent encoding.


Original URL:

Template: http://proxy.url/?url={{ urlEncode inputUrl }}

Modified URL: http://proxy.url/?


{{ insertAfter inputUrl "string-to-find" "string-to-insert" }}

Explanation: This helper inserts a string ("string-to-insert") after the first occurrence of a search string ("string-to-find") in the  URL


Original URL:

Template: {{ insertAfter inputUrl  "&authentication=ip" }}

Modified URL:


{{ insertBefore inputUrl "string-to-find" "string-to-insert" }}

Explanation: This helper inserts a string ("string-to-insert") before the first occurrence of a search string ("string-to-find") in the  URL


Original URL:

Local platform code: ABCD

Template: {{ insertBefore inputUrl "/index" platformLocalCode }}

Modified URL:


{{ removeProtocol inputUrl }}

Explanation: This helper removes either "http://" or "https://" from the start of a URL


Original URL:

Template: https://proxy.url/?url={{ removeProtocol inputUrl }}

Modified URL: https://proxy.url/?


{{ replace inputUrl "string-to-find" "replacement-string" }}

Explanation: This helper replaces each occurrence of a specified string ("string-to-find") in the URL with a replacement string ("replacement-string")


Original URL:

Template: {{ replace inputUrl "org" "com" }}

Modified URL:

Note that "replace" will replace all occurrences of the "string-to-find" that are found in the URL

Controlling the order in which changes are made

To control the order in which changes are made, parentheses can be used inside the curly brackets:


Original URL:

Template: https://proxy.url/?url={{ ( replace ( removeProtocol inputUrl ) "/ebook/" "" ) }}

Modified URL: https://proxy.url/?

In this example the "removeProtocol" happens before the "replace"

Example proxy server configuration templates

These examples are provided for guidance only.


Web page:

Example template:{{ inputUrl }}


Web page:

Example template:

http://{{ insertBefore ( removeProtocol inputUrl ) "/" "" }}

OpenAthens Redirector URLs

Web page:

Example template:{{ encodeUrl inputUrl }}

  • No labels