A Te megoldásoddal az a baj, hogy ip tartományok megadása esetén is sok száz if kellene, de a "$remote_addr = IP" miatt viszont sok ezer.