For us to help you, can you tell us what you're populating $url with?
Also, if you only want to match a certain directory, there's an easier way:
<?php
$host = preg_replace('/http:\/\/www.johninteractive\.net\/experiments\/(.*?)/', "http://www.johninteractive.net/proxy/proxyimage.php?url=$0", $url);
// Added a bunch of lines for sneakyimp's sake ;)
?>
But without actually knowing what you're putting in, and what you expect out, this is just a shot in the dark.