in reply to Redirected URL will not be displayed in the browser

Another way to do this is to send a GET request to the destination page within your script and write the lines to output as you get them. Something like this would work:

use LWP::Simple; $destURL = "http://www.yahoo.com"; $doc = get "$destURL"; print "Content-Type: text\html\n\n"; print $doc;

Basically, it will send the current HTML for $destURL to the browser as if it were yours. It will show up under your domain and URL.

NOTE: This could be used for some questionable behavior. You're basically taking someone's copyrighted material, copying it, and showing it to someone else as if it were yours. It's an interesting thing to do, but if you don't make it clear to the user that this isn't your page, it's dishonest and possibly illegal. To the extent that either of these things bothers you, please be careful with this technique.

The downside here is that your script will be hanging in the wind until it gets the response back from $destURL. If you have lots of instances running at the same time, this could create a large memory footprint. Putting a timeout in the script could help, as could running it under mod_perl so only one Perl interpreter gets forked. Then again, if you only need this once in a while, you could probably run it as-is.

Hope this helps.