Haciendo
Código PHP:
$_SERVER['HTTP_HOST'] = 'www.mipagina.com';
if (strstr($_SERVER['HTTP_HOST'], 'www.' )) {
header('Location: http://' . substr($_SERVER['HTTP_HOST'], 4) . $_SERVER['REQUEST_URI']);
exit();
}
Obtengo
Código:
Status: 302
X-Powered-By: PHP/5.2.0
Location: http://mipagina.com
Content-type: text/html
Así que el problema parece otro... probá usar SERVER_NAME en vez de HTTP_HOST a ver si funciona... pero es una posibilidad