0

I bought a domain name from 1and1 but would like it to only be accessible for people connected to our company's internal network. Is it possible to continue letting 1and1 host the domain while also preventing access to the website unless connected to company network?

thall24
  • 3
  • 1
  • 1
    Possible duplicate of [htaccess access to file by ip range](https://stackoverflow.com/questions/5042399/htaccess-access-to-file-by-ip-range) – ThisaruG May 28 '19 at 13:38

1 Answers1

0

To Make public domain name only accessible from internal network, you can place a .htaccess at the root of your host with a 403 Error for All but your company network IP (xx.xx.xx.xx).

order deny,allow
deny from all
allow from xx.xx.xx.xx

To go further and make it cleaner, you should also redirect unwanted users to a public page with this line below the previous code:

ErrorDocument 403 http://example.com
gael
  • 1,314
  • 2
  • 12
  • 20