Re: [squid-users] One more question on redirects - hopefully more clear

From: BJ Tiemessen <btiemessen@dont-contact.us>
Date: Fri, 09 May 2008 09:59:03 -0600

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You said (in a different thread) you are using squid 2.6 so I am pretty
sure you should be using url_rewrite_program instead of redirect_program.

James Wenzel wrote:
| Hello,
|
| Ok I have moved from squirm to a perl redirect. My squid.conf looks
| like this
|
| ....top stuff removed ....
| redirect_program /usr/local/squid/etc/redirector
| redirect_children 10
| visible_hostname MYSITE
| http_port 8001 accel defaultsite=www.mysite.com:8001
| cache_peer 10.1.140.202 parent 8001 0 no-query originserver name=auth
|
| My redirector looks like this
|
| #!/usr/bin/perl
| $|=1;
| while (<>) {
I needed all the parts coming in...
($url, $addr, $fqdn, $ident, $method) = m:(\S*) (\S*)/(\S*) (\S*)
(\S*)(\s+\S*)?:;

Try using the 302 redirect it has been a while since I wrote my
redirector but I think for some reason I needed to use the redirect.

$url = '302:http://www.mysite.com:8001/OA_HTML/US/ICXINDEX_BOL.htm'
if($url =~ @http://www.mysite.com:8001@);
print $url;
|
|
s@http://www.mysite.com:8001@http://www.mysite.com:8001/OA_HTML/US/ICXINDEX_BOL.htm@;
or just do:
s@http://www.mysite.com:8001@302:http://www.mysite.com:8001/OA_HTML/US/ICXINDEX_BOL.htm@;
|
| print;
| }
|
|
| when I start up squid and go to
|
| http://mysite.com:8001 I get
|
| Not Found
| The requested URL /OA_HTML/US/ICXINDEX_BOL.htm/ was not found on this
| server.
|
| in the browser. and
|
| TCP_MISS/404 484 GET http://www.mysite.com:8001/ - FIRST_UP_PARENT/auth
| text/html
|
| Please tell me what I am doing wrong.
|
| Jamie
|
| James Wenzel
| Enterprise Resource Providers
| www.enterpriserp.com
| 716 310 8236
|

- --
BJ Tiemessen
eSoft Inc.
303-444-1600 x3357
BTiemessen@eSoft.com
www.eSoft.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIJHTHxD4S8yzNNMMRAhKoAJ0bMr4QAnEl3SXtuYTTLWOiXlx73wCfZAk7
UoJgnxaHGSApumYvALdMkEo=
=Xt7X
-----END PGP SIGNATURE-----
Received on Fri May 09 2008 - 15:59:12 MDT

This archive was generated by hypermail 2.2.0 : Tue May 13 2008 - 12:00:03 MDT