How do I rewrite *.example.com to www.example.com?

Posted by Lekensteyn on Server Fault See other posts from Server Fault or by Lekensteyn
Published on 2011-11-12T17:00:48Z Indexed on 2011/11/12 17:54 UTC
Read the original article Hit count: 237

Filed under:
|

In my network, I've some Ubuntu machines which need to download files from nl.archive.ubuntu.com. Since it's quite a waste of time to download everything multiple times, I've setup a squid proxy for caching the data.

Another use for this proxy was rewriting requests for archive.ubuntu.com or *.archive.ubuntu.com to nl.archive.ubuntu.com because this mirror is faster than the US mirrors.

This has worked quite well, but after a recent install of my caching machine, the configuration was lost. I remember having a separate perl program for handling this rewrite.

How do I setup such a squid proxy which rewrites the host *.example.com to www.example.com and cache the result of the latter?

© Server Fault or respective owner

Related posts about squid

Related posts about cache