How to Set. htaccess to restrict IP Access

Source: Internet
Author: User
This year is too dark. A lot of Daniel's blogs let a bunch of people pass. A few days ago, a nuclear attack was passed. I installed B's blog two days ago, which was also threatening. Ha, in order not to let them pass by at will, I limited the IP address in the background. It's easy. You can try it. Http: www. tmdsb. comwp-admin. Will not return to wp-login.php. Direct

This year is too dark. A lot of Daniel's blogs let a bunch of people pass. A few days ago, a nuclear attack was passed.

I installed B's blog two days ago, which was also threatening. Ha, in order not to let them pass by at will, I limited the IP address in the background.

It's easy. You can try it. Http://www.tmdsb.com/wp-admin /. No wp-login is returned.Php

. Directly display 403. Use. htaccess. This is some of my collection usage. I used threeCommand:

-----------
Order deny, allow
Allow from all
Deny from 219.204.253.8
# All are accessible
-----------
Order deny, allow
Deny from 219.204.253.8
Allow from all
# All are accessible
-----------
Order allow, deny
Deny from 219.204.253.8
Allow from all
# Only 219.204.253.8 is inaccessible
-----------
Order allow, deny
Allow from all
Deny from 219.204.253.8
# Only 219.204.253.8 is inaccessible
-----------
-----------
Order allow, deny
Deny from all
Allow from 219.204.253.8
# All cannot pass
-----------
Order allow, deny
Allow from 219.204.253.8
Deny from all
# All cannot pass
-----------
Order deny, allow
Allow from 219.204.253.8
Deny from all
# Only 219.204.253.8 traffic is allowed
-----------
Order deny, allow
Deny from all
Allow from 219.204.253.8
# Only 219.204.253.8 traffic is allowed
-----------
-----------
Order deny, allow
# All are accessible (default)
-----------
Order allow, deny
# All cannot pass (default)
-----------
Order allow, deny
Deny from all
# All cannot pass
-----------
Order deny, allow
Deny from all
# All cannot pass
-----------
In the above two cases, if you change to allow from all, all traffic will be available!
-----------
Order deny, allow
Deny from 219.204.253.8
# Only 219.204.253.8 is inaccessible
-----------
Order allow, deny
Deny from 219.204.253.8
# All cannot pass
-----------
Order allow, deny
Allow from 219.204.253.8
# Only 219.204.253.8 traffic is allowed
-----------
Order deny, allow
Allow from 219.204.253.8
# All are accessible
-----------
-----------
Order deny, allow
Allow from 218.0000253.2
Deny from 218.20
# Deny the IP address starting with 218.20, but allow 218.255.253.2 to pass. Other IP addresses not starting with 218 can also pass.
-----------
Order allow, deny
Allow from 218.0000253.2
Deny from 218.20
# It is similar to the above, except that the allow and deny orders in the order statement for replacement are dropped, but the final result indicates that all statements are rejected!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.