[squid-users] Redirects with Squid

From: <reed@dont-contact.us>
Date: Fri, 21 Nov 2003 14:49:23 -0600

Greetings,

Here at UT, we are planning on using Squid on FreeBSD to control the web
browsing on some kiosks we are putting up in the health clinic. Currently we
have a kiosk web page and then two links: One that allows students to see what
they owe and the other allows them to change their address, etc online. They
have a University login to get to those pages. When they logout we have
modified the sample perl script on the Squid FAQ to redirect them back to our
kiosk page. (normally it would go to the UT homepage). So far so good.

However we have another problem: There are a number of side links on these two
web pages that go to other places in UT. We don't want that to happen. Our
initial solution was to further modify the script to have a
conditional...however this doesn't work...we cannot figure out why.

Here is what is written so far:
#!/usr/local/bin/perl
        $|=1;
        while (<>) {
if (m@^https://utdirect.utexas.edu/utdirect/index.WBX?t=MYHOME@ ||
m@^https://utdirect.utexas.edu/utdirect/bookmarks/bkms_list.WBX@ ||
m@^https://utdirect.utexas.edu/utdirect/index.WBX?t=MYJOB@ ||
m@^https://utdirect.utexas.edu/utdirect/index.WBX?t=MY40ACRES@ ||
m@^https://utdirect.utexas.edu/utdirect/index.WBX?t=MYFINANCES@)
                {
                print "https://utdirect.utexas.edu/security-443/logoff.cgi/n";
                }
This part above here (with the || statements) DOES NOT work.

The part below works fine, When going to utexas.edu we do get redirected fine.

                elsif ( m@^http://www.utexas.edu@ ) {
                       
s@http://www.utexas.edu@http://web2.uhs.utexas.edu/kiosk@;
                        print;
                } else {
                        print;
                }
        }
Has anybody else successfully modified the example redirect perl script (or any
other perl script) to control multiple links?

TIA

Robert Reed
Systems Analyst, UHS
University of Texas at Austin
Received on Fri Nov 21 2003 - 15:04:09 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:21:32 MST