WordPress.org

Ready to get started?Download WordPress

Forums

Help modifying index.php (2 posts)

  1. sarahadd
    Member
    Posted 8 years ago #

    Hello

    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.

  2. schulte
    Member
    Posted 8 years ago #

    Have you looked here yet?
    http://codex.wordpress.org/Plugins/Restriction

    Perhaps IP-Screener might be suitable in some way...

Topic Closed

This topic has been closed to new replies.

About this Topic