How can I set up a simple redirect based on an IP I supply? httacess?
I don’t run Apache I run litespeed.
You can do it via PHP.
<?php $ip=$_SERVER['REMOTE_ADDR'] if($ip=="126.96.36.199") header("Location: https://myredirect.com"); else header("Location: https://mynormalpage.com"); ?>
Replace 188.8.131.52 with the ip you want to check and the two urls to be redirected in case it matches and if not.
Thank you Brock.
And that goes on my Index page where?
Also, how may I add adnl IP’s to that?
That goes on top of your index.php page.
What you mean by "add adnl IP’s"?
Can I add more IPs to have the script redirect?
Example seperated by commas:
if($ip=="184.108.40.206, 220.127.116.11, 18.104.22.168")
So I add this to my index and save it as a php?
Use the following:
if ($ip=="22.214.171.124" || $ip=="126.96.36.199" || ip=="188.8.131.52")
What andyvon posted above will do the trick.