2010-07-19 12 views

Respuesta

13

No puede. DNS (o los archivos de host) le permite buscar direcciones IP para un nombre de host dado . No existe el concepto de reasignación de URL en este nivel de red. Esto debe hacerse en la configuración de su servidor web.

7

puede instalar localhost (MAMP, LAMP ..etc), y redirigir todos los enlaces a 127.0.0.1, luego crear script para redirigir a cualquier sitio web.

aquí es PHP ejemplo

<?php 
function curPageURL() { 
    $pageURL = "http://"; 
    if ($_SERVER["SERVER_PORT"] != "80") { 
     $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; 
    } else { 
     $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; 
    } 
    return $pageURL; 
} 
// if pageURL is facebook , redirect to medium.com 
if(curPageURL() == "http://www.facebook.com/") 
    header('Location: http://www.medium.com'); 
?> 
Cuestiones relacionadas