Yeah... this is probably because your browser is in "desktop mode".
You probably want to show some mobile version of your page when displayed on small screens so what you can try is:  
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<script type="text/javascript">  
  if ((screen.width < 480) || (screen.height < 480)) {    
    location.replace('/m/');
  }  
</script>
You need the viewport metatag for the browser to report the actual screen size.  
Edit:
According to this you might need to wait some time for the browser to "catch up" before checking the screen size so I guess it will be better to use:
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<script type="text/javascript">  
  setTimeout(function() {
               if ((screen.width < 480) || (screen.height < 480)) {    
                 location.replace('/m/');
               }  
             }, 200);
</script>