Minor correction in the code (updated below, but not working):
<?php
if ( !strstr( $_SERVER['HTTP_HOST'], 'm.' ) )
return;
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://www.google.com/reader/m/view/feed/http://' .
substr($_SERVER['HTTP_HOST'], 2) . 'feed/atom');
exit();
?>