Using the RTSP Protocol with the PHP header function

I had a great deal of trouble getting Internet Explorer to redirect the header to a RTSP link using the header function in PHP.

I found that in IE, I would get a HTTP 402 error (page has been temporarily moved). IE would happily sit there and tell me it could not be found.

Firefox was a little more robust and displayed a page which resolved an alternatve link – “Object Moved” gracing the page and a link to the rtsp link. This would also automatically open the link in Firefox.

Thankfully, I found the answer on the Jalix PHP manual.

I think that the idea is to generate a RAM-style link to the RTSP protocol rather than redirecting directly to it:


Header ("Pragma: ");
Header ("Cache-Control: ");
Header ("Expires: ");
Header ("Content-Type: audio/x-pn-realaudio");

# insert DB code here
print "rtsp://host.com:554/$filename";

That should happily create a working link to the RTSP transport.

And to Schu, yes – that saved me loads of time.

Related posts:

  1. Prevent Wordpress from Hanging when You Log on I’ve set up a Wordpress site for a client and...
  2. Block Facebook Adverts in Firefox Anyone using Facebook will know that it’s quite annoying losing...
  3. Move a print job from one queue to another in Linux Today, I was looking at my printer queue and realised...
  4. SCP and filename spaces Copying files with scp is difficult enough without spaces. So...
  5. Adding Printers will Hang a Vista Logon to a Domain Vista's UAC prevents standard users from installing printer drivers by...

Related posts brought to you by Yet Another Related Posts Plugin.

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>