Redirect Everyone Except Specified IPs


/ Published in: Apache
Save to your folder(s)

If for some reason you would want to deny everyone or allow only a specific group of IP addresses to access your website, add the following code to your .htaccess file:


Copy this code and paste it in your HTML
  1. ErrorDocument 403 http://www.domainname.com
  2. Order deny,allow
  3. Deny from all
  4. Allow from 124.34.48.165
  5. Allow from 102.54.68.123

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.