In Perl write a simple script like this :

!/usr/bin/perl
$|=1;
while (<>) {
@X = split;
$url = $X[0];
if ($url !~ /^http:\/\/www\.hostname\.com/) {
$_ = $url;
s/^http:\/\/(.*)\/(.*)/http:\/\/www.hostname.com\/\2/;
print "301:$_\n";
} else {
print "$url\n";
}
}

In your squid.conf file change the redirector_program variable, it's probably commented out, and specify where your redirector_program is, ex: /usr/sbin/redirect.pl

Make sure that the variable httpd_accel_uses_host_header is set to on, otherwise nothing will be redirected

********************************************************************************************************************
Andrew Mecca
Solutions Architect |
AXE360 LABS INC. | Embrace Technology Advantage
Email | axe360@gmail.com
Web | www.axe360.hostse.com

On Wed, Aug 5, 2009 at 1:13 PM, Kevin K. Kamonye <kkibuku@gmail.com> wrote:
Works very well with Mikrotik.

Contact me off list if interested in demo implementation.

Regards.

2009/8/5 Okechukwu <okechukwu@gmail.com>

Maybe a workaround, have a webserver on the same machine accept requests for www.xxx.com and use apache rewrite to www.yyy.com

Alternatively, using hosts file on client machines to redirect - and have like a logon script to manipulate user's host file when logs on.

Maybe reason why I may have no squid answer is that I've never had to do this :-) so however has had to, please update.

./Ok3ch


On Wed, Aug 5, 2009 at 11:26 AM, Dennis Kioko <dmbuvi@gmail.com> wrote:
yeah, someone guide on this. i once tried it and the only solution was
re director programs

On 05/08/2009, kihu kibe <kihukibe@gmail.com> wrote:
> Hi ,
>
> Scenario 1:
> Platform: Solaris 10 App: Squid 2.6 Stable ver
>
> Problem:
> Achieving url redirect on proxy clients...i.e guy enters www.xxx.com,
> proxy receives request and redirects this to www.yyy.com. To be
> achieved directly without transferring to parent peer since the proxy
> itself should not reach www.xxx.com.
>
> Anyone with syntax on squid.conf on how this is achieved? Much appreciated.
>
> Exceptions:
> NO plugins to be involved i.e squirm , squidguard etc all to be
> achieved with squid conf file.
>
> Thanks.
> _______________________________________________
> Skunkworks mailing list
> Skunkworks@lists.my.co.ke
> http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
> Other services @ http://my.co.ke
> Other lists
> -------------
> Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce
> Science:  http://lists.my.co.ke/cgi-bin/mailman/listinfo/science
> kazi:     http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general
>


--
with Regards:
Find out how you can own your own TFT T.V. at a fraction of the cost on my blog:
http://gramware.blogspot.com


_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
Other services @ http://my.co.ke
Other lists
-------------
Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce
Science:  http://lists.my.co.ke/cgi-bin/mailman/listinfo/science
kazi:     http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general



--
K. K. Kamonye

_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
Other services @ http://my.co.ke
Other lists
-------------
Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce
Science:  http://lists.my.co.ke/cgi-bin/mailman/listinfo/science
kazi:     http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general