Hi you can echo a javascript
code that contains redirection. Try this one.
<?php
if($language === "en"){
echo "<script type='text/javascript'> document.location = 'http://' . $language . '.example.com/' . $1; </script>";
}
?>
This code works most for me compared to header('Location: etc...')
.