<html><head>
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta name="Generator" content="Novell Groupwise Client (Version 14.0.0 Build: 115243)">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head><body style="font: 10pt/normal Segoe UI; margin: 16px 16px 4px; font-size-adjust: none; font-stretch: normal;"><div id="GroupWiseSection_1444844949000_klarson@k12group.net_59511A0513870000BD1BF681F57056B0_" class="GroupWiseMessageBody"><div>This is for a PHP based site, so this is extremely helpful. Thank you.</div><span style="margin-bottom: 5px; display: block;"> </span><div id="GroupWiseSection_1444844356000_herrold@owlriver.com" class="GroupWiseMessageBody"><span class="GroupwiseReplyHeader">>>> R P Herrold <herrold@owlriver.com> 10/14/2015 1:39 PM >>><br></span><div><div>On Wed, 14 Oct 2015, Angelo McComis wrote:<br><br>> Honestly, I think you have set yourself down a path where this will be difficult to support and maintain. <br>> Give each client a unique sub-url and still authenticate them by IP if you want. But don't make it complicated by trying to auto route them. <br><br>is there a purpose to unsolicited advice and prediction of <br>gloom? The matter is trivially done with the REMOTE_ADDR <br>variable and a header() command in PHP, and any mature CGI <br>environment<br><br>I'll poke at a proof of concept backed (by a database so that <br>it is readily altered as to the redirect page by a site <br>administrator). Static coding is even easier (load an array <br>with IP's to go to the execption page, test if the REMOTE_ADDR <br>is in_array(), and alternatively fall to a different header()<br><br>Here is real code to that effect. Problem is that it mixes <br>data (the IP / URL pairs, and code, which is not usually a <br>very scalable approach, along with otehr reasons<br><br><?php<br># COLUG question solution 20151014<br># Copyright (c) 2015, R P Herrold, Columbus OH<br># License GPLv3+<br># reports to: info@owlriver.com<br>$SPECIALS = array();<br>$IGNORE_TLD[] = "127.0.0.1";<br>$IGNORE_TLD[] = "12.45.67.89";<br>#<br>$DEFAULT_URL = "http://www.cnn.com/";<br>$SPECIAL_URL = "http://www.foxnews.com/";<br>#<br>$ISFROM = $_SERVER('$REMOTE_ADDR');<br># no need to defang as this is a trusted system value<br>if (in_array($ISFROM ,$SPECIALS)) {<br> header('Location: ' . $SPECIAL_URL);<br> }<br>header('Location: ' . $DEFAULT_URL);<br>?><br><br>all done<br><br>-- Russ herrold<br>_______________________________________________<br>colug-432 mailing list<br>colug-432@colug.net<br><a href="http://lists.colug.net/mailman/listinfo/colug-432">http://lists.colug.net/mailman/listinfo/colug-432</a><br></div></div></div></div></body></html>