php - How to restrict access of a specific country to my website? -
this question has answer here:
i have 2 websites different domain extensions provide same services visitors, 1 .com , other .com.au. want give access australian people visit .com.au website not .com, cannot visit .com website.
would please guide me how restrict access of australian visitors .com website? if use typo in address bar of browser's they'll automatically redirected .com.au website.
as i'm not techno guy, need firm guidance make happen. thank assistance.
first geolocation based on ip, here
the maxmind service locating countries here
there should free services google around , sure able find them
but load php library of whichever service find, feed ip of visitor $_server['remote_addr']
then redirect .au address if geolocation comes australian result
header('location: http://www.example.com.au'); put check @ top of script(s)
Comments
Post a Comment