简体   繁体   English

使公共域名只能从内部网络访问

[英]Make public domain name only accessible from internal network

I bought a domain name from 1and1 but would like it to only be accessible for people connected to our company's internal network. 我从1and1购买了一个域名,但希望只有连接到我们公司内部网络的人才能访问它。 Is it possible to continue letting 1and1 host the domain while also preventing access to the website unless connected to company network? 是否可以继续让1and1托管域名,同时还禁止访问网站,除非连接到公司网络?

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). 要使公共域名只能从内部网络访问,您可以将.htaccess放在主机的根目录下,但除了公司网络IP(xx.xx.xx.xx)之外,还有403 Error for All。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM