Welcome to the Linux Foundation Forum!

Issue PHP script with SQUID PROXY

Hi everyone,

I need to create a PHP script so my SQUID Proxy in Linux can replace a text inside

<

div> tag for another one.

In squid proxy I am using "url_rewrite_program /path/to/myscript" inside "/etc/squid/squid.config"

my script looks like this as is quite simple:


!#/usr/bin/php

<?php str_replace("NEW_TITLE","OLD_TITLE",'<div class="myDiv">

OLD_TITLE

'); ?>

The idea is that when i place the script in url_rewrite_program in squid.config when I check the website that contains

OLD_TITLE

I will replace OLD_TITLE for NEW_TITLE on the fly.

The result doesn't work so when I try to check the website the browser shows an error with the proxy. The proxy is working fine before adding the script in url_rewrite_program.

Any idea what I should do here?

Thanks!

Sign In or Register to comment.