hackerman Posted February 2, 2007 Report Share Posted February 2, 2007 Es nomainīju lapai adresi. Vajag 'pieradināt' tautu, lai nāk uz jauno adresi :) Ir iespējams uztaisīt tā, ka nočeko kāda adrese ir... if adrese = $adrese die un te redirektē uz īsto adresi ir tas iespejams? Link to comment Share on other sites More sharing options...
v3rb0 Posted February 2, 2007 Report Share Posted February 2, 2007 hackeri un nemāk atrast kā to izdarīt :p Link to comment Share on other sites More sharing options...
4e4en Posted February 2, 2007 Report Share Posted February 2, 2007 mod_rewrite? Link to comment Share on other sites More sharing options...
Stopp Posted February 2, 2007 Report Share Posted February 2, 2007 server masīva request_uri elements. vai php_self. kas nu tev tuvāk. Link to comment Share on other sites More sharing options...
hackerman Posted February 2, 2007 Author Report Share Posted February 2, 2007 Paldies, sanāca :) Link to comment Share on other sites More sharing options...
hackerman Posted February 2, 2007 Author Report Share Posted February 2, 2007 Tomēr sanāca problēma... Skatoties pēc ši piemēra $url = $_SERVER['REQUEST_URI']; if($url == '/phpref/53.php'){ echo "You are viewing the PHP Reference for REQUEST_URI"; } else { echo "You have accessed this URL improperly, We will redirect you now."; //insert meta refresh here } Es izmantoju šādu kodu <? $url = $_SERVER['REQUEST_URI']; if($url == 'lapa.lv){ echo "Tu skaties normaalu lapu"; } else { echo "<center>mees esam mainijushu nosaukumu uz lapalapa.lv tapec izmanto tadu turpmak utt :D <meta http-equiv='refresh' content='1; URL=http://lapalapa.lv'></center>"; } ?> Problēma tāda, ka visulaiku rāda, ka nepareiza lapa un redirektējas visulaiku :D Link to comment Share on other sites More sharing options...
Stopp Posted February 2, 2007 Report Share Posted February 2, 2007 <?php echo $_SERVER['REQUEST_URI']; ?> ko tev izmet? Link to comment Share on other sites More sharing options...
hackerman Posted February 2, 2007 Author Report Share Posted February 2, 2007 (edited) /test.php ... laikam man tajā linkā jānorāda vēl index.php ? :D itkā tagad izmainīju uz if($url == 'http://lapa.lv/index.php'){ Vienalga tas pats... Edited February 2, 2007 by hackerman Link to comment Share on other sites More sharing options...
Roze Posted February 2, 2007 Report Share Posted February 2, 2007 Jāpārbauda ir $_SERVER['HTTP_HOST'] vai $_SERVER['SERVER_NAME'] nevis request_uri ... Link to comment Share on other sites More sharing options...
hackerman Posted February 2, 2007 Author Report Share Posted February 2, 2007 (edited) ok pamēģināšu :) Edited February 2, 2007 by hackerman Link to comment Share on other sites More sharing options...
Stopp Posted February 2, 2007 Report Share Posted February 2, 2007 Jā, piedošanu, kļūdījos. Ne request_uri, ne php_self šeit neder. Link to comment Share on other sites More sharing options...
hackerman Posted February 2, 2007 Author Report Share Posted February 2, 2007 (edited) šķiet, ka arī $_SERVER['SERVER_NAME'] neder... Roze, paldies :) $_SERVER['HTTP_HOST'] der :) Edited February 2, 2007 by hackerman Link to comment Share on other sites More sharing options...
4e4en Posted February 3, 2007 Report Share Posted February 3, 2007 manuprāt to pašu var panākt ar RewriteCond %{HTTP_HOST} !myoldsite.net.*$ [NC] RewriteCond %{HTTP_HOST} !^http://mysite.net/.*$ [OR,NC] RewriteRule .* http://www.mysite.net/ [L,R] Link to comment Share on other sites More sharing options...
Recommended Posts