简体   繁体   中英

How to restrict website access from ip address

i have a app hosted on xyz.com domain and that domain on digital ocean server that contain xxx.xxx.xxx.xxx ip address

so the issue is that if user enter ip address instead of website then they can get the access of that website so how can we restrict user from accessing website through ip address. i need to make it work like each user access it from https url URL incited of ip address

There are many ways but the simple one is to use .htaccess file use the below code to restrict any ip like this

Order Deny,Allow
Deny from 127.0.0.1
Deny from 127.0.0.2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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