Ver Mensaje Individual
  #6 (permalink)  
Antiguo 03/10/2007, 14:27
Avatar de Seppo
Seppo
 
Fecha de Ingreso: marzo-2005
Ubicación: Buenos Aires, Argentina
Mensajes: 1.284
Antigüedad: 19 años, 1 mes
Puntos: 17
Re: Redirigir www a no-www con PHP ?

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