RE: [squid-users] Apache 301 redirects working with squid

From: Drew Wrobel <phoenix1972_at_hotmail.com>
Date: Wed, 13 Jan 2010 09:46:38 -0500

----------------------------------------
> Date: Wed, 13 Jan 2010 11:48:53 +1300
> From: squid3_at_treenet.co.nz
> To: squid-users_at_squid-cache.org
> Subject: Re: [squid-users] Apache 301 redirects working with squid
>
> Chris Robertson wrote:
>> Drew Wrobel wrote:
>>>> Date: Fri, 8 Jan 2010 12:23:11 -0900
>>>> From: crobertson_at_gci.net
>>>> To: squid-users_at_squid-cache.org
>>>> Subject: Re: [squid-users] Apache 301 redirects working with squid
>>>>
>>>> Drew Wrobel wrote:
>>>>
>>>>> I have the redirects working with squid and apache.
>>>>>
>>>>> Of course now I have a new wrinkle.
>>>>>
>>>>> Here are the rules I currently have defined:
>>>>>
>>>>>
>>>>> http_port 80 accel vport
>>>>> cache_peer 172.21.174.78 parent 80 0 no-query originserver
>>>>> round-robin login=PASS
>>>>> acl mainSite dstdomain www.company.com
>>>>> http_access allow mainSite
>>>>> cache_peer_access 172.21.174.78 allow mainSite
>>>>> cache_peer_access 172.21.174.78 deny all
>>>>> acl otherSites dstdomain .company.com
>>>>> deny_info http://www.company.com/ otherSites
>>>>> http_access deny otherSites
>>>>> http_access deny all
>>>>>
>>>>> I have about 70+ addtional domains that I need to redirect them all
>>>>> to the default of www.company.com
>>>>>
>>>>> The domains are anything from 1800company.com, 1-800-comany.com,
>>>>> various .net/.biz/.org/.info and other
>>>>> combinations.
>>>>>
>>>>> It there a simple/easy acl that I can use as a catch all, if you
>>>>> will, for anything that isn't www.company.com to have it
>>>>> redirected to www.company.com?
>>>>>
>>>> I haven't tested this, but I think it should work...
>>>>
>>>> acl mainSite dstdomain www.company.com
>>>> http_access allow mainSite
>>>> http_access deny !mainSite
>>>> deny_info http://www.company.com/ mainSite
>>>>
>>>> Chris
>>>>
>>>>
>>> That seems to work. Here is that I have defined:
>>>
>>>
>>>
>>> acl mainSite dstdomain www.company.com
>>>
>>> http_access allow mainSite
>>>
>>> http_access deny !mainSite
>>>
>>> deny_info http://www.pepboys.com/ mainSite
>>>
>>> http_access deny all
>>>
>>>
>>>
>>> Wasn't sure if the last deny was needed but put it in as a catch all
>>> just in case.
>>>
>>>
>>> Should the deny_info line end with mainSite or !mainSite?
>>
>> Your deny_info line is correct.
>>
>>
>> Chris
>>
>
> Drew:
> you can start the redirect URL with "301:" or "302:" to set the
> redirect code if needed.
> ie: deny_info 301:http://www.company.com/ mainSite
>
> Amos
> --
> Please be using
> Current Stable Squid 2.7.STABLE7 or 3.0.STABLE21
> Current Beta Squid 3.1.0.15

I tried the above deny_info 301 but it doesn't work.

The following is what I get in the access.log.

test.company.com 172.21.84.170 - - [13/Jan/2010:02:51:18 -0500] "GET
http://172.21.219.60/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/301:http://www.company.com/
HTTP/1.1" 302 325 "-" "Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4;
en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7" TCP_DENIED:NONE

I checked the squid 2.7 documentation, and it doesn't make any reference to doing what you suggested.  Only that it would do a 302 redirect.  It's not the end of the world if I can't get the redirect to come back as a 301.

                                               
_________________________________________________________________
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
http://clk.atdmt.com/GBL/go/196390706/direct/01/
Received on Wed Jan 13 2010 - 14:46:46 MST

This archive was generated by hypermail 2.2.0 : Wed Jan 13 2010 - 12:00:03 MST