Since it seems that you acknowledged what I last typed on the last part, I believe you would need more information.
Now, how this would work is by using .htaccess, the IP allow/deny "commands," and an custom error document. Plenty of guides online of how to pull it off.
You will need to create...