General

How to Block IP Using IP Manager and .htaccess

How to Block IP Using IP Manager and .htaccess? Tired of malicious users exploiting your website’s security? Now you will be able to end such users! Don’t worry, I will help you with the article I have prepared for those who have trouble in this regard. How to block IP with IP manager and .htaccess file? Wordpress country blocking? I will share my knowledge about Wordpress IP blocking.

Why Do We Need IP Blocking?

The Internet network is a public place that can be accessed 24/7. Since it is open to everyone, many large companies move their companies online, making this a good opportunity for themselves. However, there is a point they forgot, since the internet is a public domain, not all people who use the internet have good intentions. For this reason, the privacy and security of everyone You ask why? Today, crime rates have increased considerably. Regardless of whether it is in your city or on your website, there are people in the world who have the capacity to do their best to cause you all kinds of damage such as spam, hacking.

The damage they want to inflict on your site may vary from person to person. A malicious person can write spam or insulting comments under the content you have added to harm your site and disturb other users. If you do not intervene in this situation in time, it can cause a security vulnerability on your site over time.on the internet network is in danger.

The biggest precaution to prevent such people from causing security vulnerabilities on your site will be to determine the Internet Protocol (IP) addresses and block them. IP addresses are indispensable unique identifiers on all machines. You can easily cut off contact with your site by blocking the IP address of a user who will harm your site.

There are 2 methods for you to do IP blocking. The first of these is IP blocking using .htaccesses, and the second is IP blocking with IP manager. I have explained how to do both of these methods and how to block as a country in the most detailed way below;

IP Blocking Using IP Manager

We can do IP blocking with IP manager.

IP Blocking Using IP Manager

First of all, you need to enter your panel with the panel information that your hosting company has given you.

Log in to the “IP Manager” section in the panel that appears.

Enter the IP address you want to be blocked in the text box opposite the “Block IP Address” section on the screen that comes up, and click the “Add” button.

Type your IP Address that you want to unblock in the text box opposite the “Allow IP Address” section.

If the steps are completed successfully, a confirmation message will appear on the screen.

The IP address that you think may harm your site will no longer be able to access your site. You can repeat these steps as many times as you want to block IP addresses on your site.

IP Blocking Using .htaccess

Another IP address blocking method is done with the .htaccess file.

IP Blocking with .htaccess File

First, access your site files with the panel or FTP.

Then go to Files > File Manager.

Enter the “.htaccess” file in the “public_html” file, which is one of your site files, and right click and select edit.

Add the piece of code that I will give below to the screen that appears in the Edit field.

order Deny, Allow

deny fromIPaddress you want to block

In case of a possible error, it is useful to make a backup of the file before adding the code. If you want to block more than one IP, you can use the “deny from IPaddress” command more than once. After adding the code, save and exit.

You have easily completed the IP blocking process from your .htaccess file.

.htaccess Country Blocking

In some cases, the attacks your site receives can be made from a single country. Instead of blocking the individual IP addresses of the attackers, it would be more logical to block the entire country. In this way, we remove all attacks on our site from the root.

First, access your site files with the panel or FTP.

Open the “.htaccess” file located in the “public_html” folder. Then select the country you want to block from the link I will give you and select the “Apache.htaccess Deny” option and click the “Create ACL” button. Copy all the IP addresses in the list under the heading “ACL Results” and write “order Deny, Allow” at the beginning and add to your .htaccess file.

Save the changes and close the page.

The whole world will be able to access your site except the country you have blocked.

Conclusion

If you learned from which IP the attacks on your site were made, blocking that IP will be a very effective result. I explained how to do this with IP manager and .htaccess file. If there is a place where you get stuck during the process, you can let me know from the communication section or my social media accounts.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button