Re: [squid-users] to silly to redirect

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Fri, 30 Nov 2001 10:03:16 +0100

"Stefan M. Brandl" wrote:

> Yes, of course.
> I get this in access.log:
>
> 1007103661.653 8 212.77.162.22 TCP_MISS/200 1364 GET http://squid.nlanr.net/ - DIRECT/212.77.161.1 text/html
> 1007103661.766 8 212.77.162.22 TCP_MISS/200 1364 GET http://squid.nlanr.net/html/kopf/rkom/home/home.html - DIRECT/212.77.161.1 text/html
> 1007103661.779 8 212.77.162.22 TCP_MISS/200 1364 GET http://squid.nlanr.net/html/links/rkom/home/home.html - DIRECT/212.77.161.1 text/html
> 1007103661.785 6 212.77.162.22 TCP_MISS/200 1364 GET http://squid.nlanr.net/templates/suche.html - DIRECT/212.77.161.1 text/html
> 1007103661.788 7 212.77.162.22 TCP_MISS/200 1364 GET http://squid.nlanr.net/html/mitte/rkom/home/home.html - DIRECT/212.77.161.1 text/html
> 1007103661.879 21 212.77.162.22 TCP_MISS/200 1364 GET http://squid.nlanr.net/html/kopf/rkom/home/home.html - DIRECT/212.77.161.1 text/html
> 1007103661.883 8 212.77.162.22 TCP_MISS/200 1364 GET http://squid.nlanr.net/templates/suche.html - DIRECT/212.77.161.1 text/html
>
> and so on. It ends in an endless loop.
> In the above example I entered squid.nlanr.net and wanted to be
> redirected to www.r-kom.de

I would say it seems it worked.

Whatever you request you get redirected to http://www.r-kom.de/ EXACLY
without notifying the browser. As there is no exception for www.r-kom.de
itself, everything requested from there is also redirected to
http://www.r-kom.de/, including links or images on the page.. As the
browser is not notified, it still thinks it is on the originally
requested site.

I think you may want a slightly smarter redirection than "redirect
everything to http://www.r-kom.de/". Most likely you want "redirect
everything except requests for www.r-kom.de to http://www.r-kom.de/
using a browser redirect".

#!/usr/bin/perl -n
BEGIN { $|=1; }
m%^http://www.r-kom.de/%i && print("\n") && next;
print "302:http://www.r-kom.de/\n";

Regards
Henrik
Received on Fri Nov 30 2001 - 02:15:08 MST

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