February 2011
Intermediate to advanced
332 pages
9h 3m
English
Let's see a very simple Perl script that can act as a URL redirector program.
$|=1;
while (<>) {
s@http://www.example.com@303:http://www.example.net@;
print;
}The previous code is a URL redirector program in its simplest form. It redirects all URLs containing the URL www.example.com to www.example.net without inspecting values of any of the fields by Squid.
We have just seen a simplistic Perl script which can act as a URL redirector program and can be used with Squid.
Modify the previous URL redirector program so that all requests to google.co.uk can be redirected to google.com.
We can make our URL redirector programs ...
Read now
Unlock full access