<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.&nbsp; Thank you.</div><span style="margin-bottom: 5px; display: block;">&nbsp;</span><div id="GroupWiseSection_1444844356000_herrold@owlriver.com" class="GroupWiseMessageBody"><span class="GroupwiseReplyHeader">&gt;&gt;&gt; R P Herrold &lt;herrold@owlriver.com&gt; 10/14/2015 1:39 PM &gt;&gt;&gt;<br></span><div><div>On Wed, 14 Oct 2015, Angelo McComis wrote:<br><br>&gt; Honestly, I think you have set yourself down a path where this will be difficult to support and maintain. <br>&gt; 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?&nbsp; 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).&nbsp; 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.&nbsp; 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>&lt;?php<br>#&nbsp;&nbsp;&nbsp;&nbsp;COLUG question solution 20151014<br>#&nbsp;&nbsp;&nbsp;&nbsp;Copyright (c) 2015, R P Herrold, Columbus OH<br>#&nbsp;&nbsp;&nbsp;&nbsp;License GPLv3+<br>#&nbsp;&nbsp;&nbsp;&nbsp;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>#&nbsp;&nbsp;&nbsp;&nbsp;no need to defang as this is a trusted system value<br>if (in_array($ISFROM ,$SPECIALS)) {<br>&nbsp;&nbsp;&nbsp;&nbsp;header('Location: ' . $SPECIAL_URL);<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>header('Location: ' . $DEFAULT_URL);<br>?&gt;<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>