[ale] Intercepting content from http server and inserting content back in

Daniel Kahn Gillmor dkg at fifthhorseman.net
Tue Jan 6 13:44:29 EST 2009


On 01/06/2009 01:23 PM, Chris Kleeschulte wrote:
> I have a test system that runs a LAMP app. This test system is  
> identical to the production system, so frequently I worry that I will  
> mistake one firefox window containing the test system for the  
> production one.

a reasonable fear!  if you really want to munge the html and you have
control over the whole lamp stack, you might look into apache's filtering:

  http://httpd.apache.org/docs/2.2/mod/mod_filter.html

But i have an alternate proposal that might work better (and easier)
than filtering all the content.  Most webapps these days use CSS with a
roughly static stylesheet for page styling.  I'd simply include a local
stylesheet for each version of the app, and style something
significantly different on each one.  For example, on the main site:

 body { background: blue; }

and on the test site:

 body { background: red; }

Another alternative would be to adjust the site's shortcut icon
(/favicon.ico by default for IE, but adjustable in the header for better
browsers with <link href="/whatever.png" rel="shortcut icon" />).  This
would show up in the URL bar and the tab itself for each page.

Choosing this route would mean that you only need to change one static
file on each site, and every page will automatically be visually
distinct.  no filtering, no need to look for the string "TEST" in the
page, etc.

hth,

	--dkg

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 890 bytes
Desc: OpenPGP digital signature
Url : http://mail.ale.org/pipermail/ale/attachments/20090106/c3463295/attachment.bin 


More information about the Ale mailing list