Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have setup our network as per the tutorial here: Basically, we have a squid proxy that inverts images for pages that clients request.

We're trying to modify the script so that we can edit the contents of the webpage before the webpage is sent to the client. We are not having any luck. I'm wondering if there is something different about .html files that makes this not possible.

What is happening is that we do a wget on the URI that is requested, save it locally, modify it and then echo back the new URI. The page that the user gets is the unmodified page and not the one that we just changed.

share|improve this question
Have you tried echoing back the modified content? i remember doing the whole proxy mogrification thing on images for an April fools day joke but can't remember if it sent back the image url or the content. – Aaron Tate Mar 24 '10 at 8:14
The link contains a dot that breaks it. Correct Link: – chiborg Oct 16 '12 at 13:07
up vote 2 down vote accepted

From the info you've provided, it sounds like you might be best served with something like sqirm. It's a specifically designed program to interact with squid via url_rewrite_program and is probably better than re-inventing the wheel with you're own perl/bash script.

If you still want to do it manually, theres this:

share|improve this answer
Hey. From the info you've provided, it sounds like you haven't read anything about the question. He wanna put new content to the requested webpage content before send it back. – erm3nda May 27 '14 at 6:32

Seems not easy. Please check that and that

On the Glyple webproxy it's just easy, and it'd done by PHP or adding it from it's configuration page.

Anyway, i think Glype has not full capabilities like squid.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.