Skip to main content
OCLC Support

Starting point URLs and config.txt

Learn about starting point URLs and config.txt files in this EZproxy overview.

Starting point URL

A starting point URL consists of two parts, the proxy prefix and the target URL. The proxy prefix identifies your server, and it will always be the same. The target URL is the unique URL of the resource to which you are directing your users and providing proxied access. This URL must be configured correctly in your config.txt file for this starting point URL to work.

The following are two examples of starting point URLs:

Stand-alone: http://ezproxy.abclib.org:2048/login?url=http://www.sciencedb.com
Hosted: http://abclib.idm.oclc.org/login?url=http://www.sciencedb.com

This starting point URL can be broken down in the following parts:

Starting point URL

You can use this formula:

Proxy prefix + Target URL

to create links to the URL for any of the resources licensed by your institution. However, to ensure your users will be able to access these resources through EZproxy, you will need to configure these resources correctly in your config.txt. For a more detailed discussion of the relationship between starting point URLs and database stanzas, please see Understanding URLS and database stanzas and the information below.

Starting point URLs and config.txt

Overview

When you subscribe to a new resource, you will probably want to add a new Starting Point URL for that resource to your list of electronic resources. To ensure access, that link will need to have a corresponding database definition in config.txt. However, you may not always need to add a new stanza or even a new directive statement when you create this new starting point URL. This table and the more detailed information in the tabs will help you determine whether an existing stanza will provide access to your new resource or if you need to add a new directive statement or entire stanza.

Suppose you subscribe to the fictional Science Database, and you have already added the following stanza to your config.txt file:

Title Science Database
U http://www.sciencedb.com
DJ sciencedb.com

When you add starting point URL links to individual resources licensed by Science Database, you may or may not have to add additional directives to this stanza. Use the table below as a point of comparison for your licensed resources to determine if additional stanzas or directive statements need to be added to your config.txt to allow use of a new Target URL in an SPU. Clicking on the corresponding tabs above will provide you with additional information about how these URLs interact with the database stanzas. These tabs each use URL terminology in their explanations; for more detail about this terminology, please see Understanding URLs and Database Stanzas.

Target URL Use existing Add host or HJ
http://www.sciencedb.com
For more details, see Simple target URLs
X  
https://www.sciencedb.com
For more details, see Target URLs with https
 
Title Science Database
U http://www.sciencedb.com
HJ https://www.sciencedb.com
DJ sciencedb.com
http://www.sciencedb.com/biology
For more details, see tab Target URLs with paths
X  
http://www.astronomy.sciencedb.com
For more details, see Target URLs with variations
 
Title Science Database
U http://www.sciencedb.com
HJ http://www.astronomy.sciencedb.com
DJ sciencedb.com

Simple target URLs

When a user clicks on either of the starting point URLs:

http://ezproxy.abclib.org:2048/login?url=http://www.sciencedb.com
OR
http://abclib.idm.oclc.org/login?url=http://www.sciencedb.com

EZproxy will begin reading the config.txt file looking for a URL, Host, or HostJavascript (HJ) directive that matches the target URL, http://www.sciencedb.com.

Order Matters

EZproxy reads the config.txt file from beginning to end and begins processing after the first match that it finds.  Because EZproxy will proxy your starting point URL using the first URL, Host, or HJ statement that matches your Target URL, EZproxy will only apply the processing instructions (such as Find and Replace) from the first stanza match it reads, ignoring any later matches.

Finding a Match with the URL Directive

When EZproxy reads the following stanza in your config.txt, it will provide a match for both starting point URLs listed above:

Title Science Database
URL http://www.sciencedb.com
DomainJavascript sciencedb.com

The URL directive statement in this stanza contains the URL, http://www.sciencedb.com, which matches the origin in the starting point URL, http://www.sciencedb.com. With this match, EZproxy will redirect an EZproxy-authenticated remote user to the resource located at the target URL http://www.sciencedb.com.

Finding a Match with the HJ Directive

The following stanza will also provide a match for the starting point URLs listed above, but the match will come in the HJ statement:

Title Science Database
URL http://www.schooldb.com
HJ www.sciencedb.com
DomainJavascript sciencedb.com

In this case, the hostname following the HJ directive, www.sciencedb.com, also matches the origin in the starting point URL, http://www.sciencedb.com, because the Host and HJ directives assume the hostname is preceded by http if there is no scheme given. With this match, EZproxy would redirect an authenticated user to the resource located at the target URL http://www.sciencedb.com and rewrite any javascript from this page.

 Note: In the chart above, the example match is given with the origin and the URL statement, but as described in Finding a Match with the HJ Directive, the target URL would also match with the following directive statements:

Host www.sciencedb.com
HostJavascript www.sciencedb.com 
URL directive flow

Target URLs with https

If the target URL for Science Database is using a secure, https scheme instead of http,

https://www.sciencedb.com

your starting point URLs would be changed as follows:

http://ezproxy.abclib.org:2048/login?url=https://www.sciencedb.com
OR
http://abclib.idm.oclc.org/login?url=https://www.sciencedb.com

With the change in scheme from http to https, the original stanza;

Title Science Database
URL http://www.sciencedb.com
DomainJavascript sciencedb.com

will no longer provide a match for the target URL. As a result of this change in the target URL scheme, the stanza would need to be updated as follows:

Title Science Database
URL http://www.sciencedb.com
HostJavascript https://www.sciencedb.com
DomainJavascript sciencedb.com

The URL was left in place to ensure continued access to the target URL with the http scheme, but an additional HostJavascript line was added to ensure that EZproxy would also find a match for the target URL with the https scheme.

 

URL with https

Target URLs with paths

If you subscribe to individual resources that are part of the Science Database collection, such as the Biology Journal, Astronomy Journal, and Chemistry Journal, you might want to use these resources' URLs in starting point URLs to send users directly to those resources.

Before you create new database stanzas for each of these resources, you should first compare the URLs for these resources to the existing Science Database stanza in your config.txt because you might not need to create additional stanzas. Consider the following resource URLs:

Biology Journal: http://www.sciencedb.com/biology
Astronomy Journal: http://www.sciencedb.com/astronomy
Chemistry Journal: http://www.sciencedb.com/chemistry

The following table presents the breakdown of the URLs for each of the science journals:
 

URL Origin Path
http://www.sciencedb.com/biology http://www.sciencedb.com /biology
http://www.sciencedb.com/astronomy http://www.sciencedb.com /astronomy
http://www.sciencedb.com/chemistry http://www.sciencedb.com /chemistry

Each of these individual resources contain the same origin as Science Database but also have a path at the end. When EZproxy reads the config.txt to determine if the target URL in a given starting point URL matches any URL, Host or HostJavascript statements in config.txt, it looks only at the origin URL and ignores the path and any information following it.

So, the existing database stanza:

Title Science Database
URL http://www.sciencedb.com
DomainJavascript sciencedb.com

would provide a match in the URL directive line for each of these origin URLs, and a user who clicked on a link to any of the following starting point URLs:

http://ezproxy.abclib.org/login?url=http://www.sciencedb.com/biology
http://ezproxy.abclib.org/login?url=http://www.sciencedb.com/astronomy
http://ezproxy.abclib.org/login?url=http://www.sciencedb.com/chemistry

would be taken to the proxied URL.

spurl and path workflow.png

Target URLs with variations

In this final example, let's assume that the URLs for the individual resources (Biology Journal, Astronomy Journal, and Chemistry Journal) that are part of the Science Database collection are not constructed with paths as in the previous example. Instead the URLs for these individual resources are as follows:

Astronomy Journal: http://www.astronomy.sciencedb.com
Biology Journal: http://www.biology.sciencedb.com
Chemistry Journal: http://www.chemistry.sciencedb.com

When compared against the URL in the original database stanza in the config.txt file, we no longer have a match because each of these Target URLs is unique. Thus, the database stanza would need to be created differently to provide matches for each of these URLs so they could be used in starting point URLs; however, one stanza could still provide matches for the original database and each of these additional resource pages.

Adding Host or HostJavascript statements to the original database stanza would provide EZproxy with matches for each of the URLs listed above. This would allow you to use them as part of starting point URLs. The database stanza could look as follows:

Title Science Database
URL http://www.sciencedb.com
HJ www.astronomy.sciencedb.com
HJ www.biology.sciencedb.com
HJ www.chemistry.sciencedb.com
DJ sciencedb.com

The following matches would be made for the following origins if used in starting point URLs when EZproxy read through the config.txt and found the corresponding HJ statements:

Target URL Directive
http://www.sciencedb.com HJ www.astronomy.sciencedb.com
http://www.sciencedb.com HJ www.biology.sciencedb.com
http://www.sciencedb.com HJ www.chemistry.sciencedb.com

 

Starting point URL target URLs with variations workflow