Restricting access to URL's and Redirect to other URL

For general issues related to PWB v2.

Moderators: Tyler, Scott, PWB v2 Moderator

Post Reply
Michael

Restricting access to URL's and Redirect to other URL

Post by Michael »

Can I restrict users from accessing particular URL's and redirect them to another URL instead?

Thanks,

Michael

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Post by Scott »

Not currently, but I could easily add it if you only wanted to redirect to a single URL.

--Scott

phillipbrickner
Contributor
Contributor
Posts: 31
Joined: Fri Jan 28, 2011 9:23 am

Post by phillipbrickner »

Hi, I am in a bind and need a redirect. We set up are apached config to redirect on the website for a certain link but on the kiosk we want it to hit a different link. Long story short we are using different skins for our opac. Can you help me with this it looks like you had a possible fix for this. I need it to redirect a folder request or a specific link to another specific link.
Thanks in advance for looking into this
Phil

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Post by Scott »

This is a pretty old post from 2003.

In 2004 we added [Dialogs] AccessURLRedirect= in PWB v2.05 which redirects to the specified URL when a URL is denied.

This may fit your needs.

To have PWB redirect to a specific URL for a specific URL could be added, but this will require maintaining a separate list of paired URLs.

--Scott

phillipbrickner
Contributor
Contributor
Posts: 31
Joined: Fri Jan 28, 2011 9:23 am

Post by phillipbrickner »

How would I go by doing to paired list. For example I wanted to send someone from a our homepage http://www.ualibrary.org/index.php to our catalog http://vtls.ualibrary.org/cgi-bin/gw/ch ... arch=kiosk. Is this possible and if so then how?

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Post by Scott »

We will need to develop a paired list functionality for PWB in order to be able to do this.

Do you set the PWB home page to the catalog page?

--Scott

phillipbrickner
Contributor
Contributor
Posts: 31
Joined: Fri Jan 28, 2011 9:23 am

Post by phillipbrickner »

No it I have a custom local web page for the home page for pwb. I then open the catalog in a iframe. And I need that I frame not to go to get redirected if it opens a epecific url. The actual url is http://vtls.ualibrary.org/cgi-bin/gw/ that I do not want it to go to. I would like it get redirected to http://vtls.ualibrary.org/cgi-bin/gw/ch ... =SEARCHSCR.

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Post by Scott »

PWB v2.11.2 (02-01-2011) has the following functionality added.

[Files] CheckURLRedirectFile= Tab delimited list of paired URL -> redirect URL.
[Security] CheckURLRedirect=False Enable URL redirects (uses [Files]CheckURLRedirectFile=).

This allows for a paired list of URLs to redirect.

You will need to download this new version of PWB, copy it over your old version of PWB v2.11.x, and add the following to your current INI file.

Code: Select all

[Files]
CheckURLRedirectFile=C:\path to file\URLDirect.txt

[Security]
CheckURLRedirect=True
In URLDirect.txt add the following.

Code: Select all

http://vtls.ualibrary.org/cgi-bin/gw/	http://vtls.ualibrary.org/cgi-bin/gw/chameleon?skin=kiosk&search=SCAN&function=SEARCHSCR&SourceScreen=SEARCHSCR
Please note the URLs are on one line separated by a tab.

--Scott

phillipbrickner
Contributor
Contributor
Posts: 31
Joined: Fri Jan 28, 2011 9:23 am

Post by phillipbrickner »

Thank for making this such a top priority and coming out with an update so fast. It's not working though. I think what you are doing is changing the host file. Since my address are on the same domain and the host file is not url specific it is getting stuck in an infinite loop or redirects.

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Post by Scott »

What PWB is doing is watching for the URL in the OnBeforeNavigate function and changing the URL if a match is found before navigating to the URL. It is not touching the HOSTS file.

Check you are using PWB v2.11.2 (02-01-2010) by viewing the Help About dialog. (Yes we need to update it to 2011 :oops:)

Did you enable it by adding the following to your INI file?

[Security]
CheckURLRedirect=True

Did you create a file with paired URLs separated by a single tab that is specified in the following?

[Files]
CheckURLRedirectFile=C:\path to file\URLDirect.txt


Please send a copy of your "CheckURLRedirectFile" file as an attachment to support@teamsoftwaresolutions.com and we can take a look at it.

--Scott

phillipbrickner
Contributor
Contributor
Posts: 31
Joined: Fri Jan 28, 2011 9:23 am

Post by phillipbrickner »

Before I send any files my redirect is the same as above. If I change the redirect to something else like ualibrary.org it will go to it. Otherwise if I leave it how we need it (like above), you can see the infinite loop of redirects.

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Post by Scott »

That would be a problem, however the URL redirect filter uses Regular Expressions. So you can use the begins with ("^") and ends with ("$") characters to match the whole URL only.

Example:

Code: Select all

^http://vtls.ualibrary.org/cgi-bin/gw/$   http://vtls.ualibrary.org/cgi-bin/gw/chameleon?skin=kiosk&search=SCAN&function=SEARCHSCR&SourceScreen=SEARCHSCR
This will match the URL is it both begins with itself and ends with itself.

We posted a new version that corrects a problem if you have cache filter files set to true, which you should to prevent many disk reads.

--Scott

phillipbrickner
Contributor
Contributor
Posts: 31
Joined: Fri Jan 28, 2011 9:23 am

Post by phillipbrickner »

Thanks Scott works perfect!

Post Reply