How to create a redirect in PHP if the url is a specified? -


After

I want to redirect local hosts to my ip in a file. If I see it with my IP then there is no redirection I have some code writed but do not do any work

  "; // resonant $ _SERVER ['SERVER_NAME'] $ _ server ['REQUEST_URI']; // if $ real_link =; // if $ _SERVER [REQUEST_URI] = "/docs/headertest.php" {// header ('location: http: //MYIP/docs/headertest.php')}; // $ url = "$ _SERVER [HTTP_HOST] $ _ server [REQUEST_URI]"; // echo $ url; // if $ url = "localhost / docs / headertest.php" {// resonance "AD";}; // headers ('location: http: //MYIP/docs/headertest.php');}; $ url = "http: //" $ _ Server [HTTP_HOST]. $ _ Server [REQUEST_URI]; $ Localhost = "http: //localhost/docs/headertest.php"; If $ url = ($ local host) {header ('location: http: //MYIP/docs/headertest.php');}? & Gt;   

Thanks.

should be:

  $ url = "http: / / ".. $ _ Server [HTTP_HOST] $ _ server [REQUEST_URI]; $ Localhost = "http: //localhost/docs/headertest.php"; If ($ url == $ localhost) {header ('location: http: //MYIP/docs/headertest.php'); }    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -