Redirect from a PDF file

Hi I wonder if anyone can help. I have a server redirect from 2 outdated pdfs to a gallery page. On this gallery page I have this PHP code to redirect to the the new pdf based on the previous url entered.

if ($url == '') {
header( "HTTP/1.1 301 Moved Permanently" );
header( "Location:" );	
} elseif ($url == '') {
header( "HTTP/1.1 301 Moved Permanently" );
header( "Location:" );	

This code works fine on our dev server - but on the live server the user just stays on the gallery page!

Any ideas why?


In order of preference to see what is going on, add:

echo $url ;

//or pipe to your error logs with trigger_error() 
$debug = var_export( $_SERVER) ;

// or even temporarily use - if you are feeling brave