将COM-Domain直接访问重定向到英语站点

I want to redirect a direct access to the website to its English content. Do you see any problem or improvement of my code?

/* 
 * Load English page if *.com domain
 */
$domain = $_SERVER['SERVER_NAME'];
$extension = pathinfo($domain, PATHINFO_EXTENSION);
if($extension == "com" &&
   !preg_match('/'.$domain.'/', $_SERVER['HTTP_REFERER']) &&
   $_SERVER['REQUEST_URI'] == '/'){

        header('Location: /en/');
        exit;

}

One problem I see is that if the users browser has HTTP_REFERER deactivated he couldn't access to http://domain.com. Is there a better solution?


EDIT

Here example of the usage:

  • direct access to http://domain.com should be forwarded to http://domain.com/en/
  • If the the user clicks the link to the base <a href='/'>home</a> or <a href='http://domain.com'>home</a> it should not be redirected.