On my website, my wordpress blog is located in the folder /blog.
In the folder /approve/list, I have 10 text files called 1.txt, 2.txt all the way up to 10.txt. These text files have list of ip addresses that are approved to access my site.
Is there some code I can add to my wordpress index.php file that would check the IP address of the user that is visiting my site. It would compare this ip address with the ip addresses in each of the 10 text files.
If there is a match, the blog would display.
If there is not a match, the user would be redirected to another page.
I know people are going to suggest htaccess to solve this, or that IP addresses are dynamic, but the users that will visit my site that are approved will have static addresses, so this would work well.
Thank you for your help.
- The topic ‘Help modifying index.php’ is closed to new replies.