Privacy invaders, Hackers, Competitors and others attack your site to lower your rank or try to cause inconvenience, so your business does not do well.
YouStable offers cPanel full version to the registered users so that you can get the most out of the features. cPanel offers a .htaccess file, and you have the power to block IP addresses.
First, we are going to show you, how you can access the cPanel and reach the .htaccess file.
Step 1: Log in to the cPanel by adding (domain.com/cpanel) and then hit enter. If you have forgotten the credentials, then open the email client associated with the YouStable account because we send a copy of the credentials to the registered email as well.
Step 2: In the search bar, type “file manager” and select the first result.
Step 3: Double-click on the “public_html” and then it will take you one step closer to completing the process.
Step 4: cPanel hides the file, so you have to click on the “settings” located on the same page at the top, and a pop-up appears on your screen.
Step 5: Click on “show hidden files” and then click on “save” to complete the process.
Step 6: Now, select the .htaccess file, and right-mouse click to view more options, and click on “edit” it.
Step 7: The confirmation pop-up shows up, and click on “edit” to proceed.
Step 8: The .htaccess file is now editable.
Step 9: Go to the IPDENY site to copy the IP address of specific country, and click on “download zone file” to download a text file, or you can click on “aggregated zone file” to view the IP address in another window.
Step 10: Okay, now you have to follow the order from the codes below.
(order allow, deny deny from http://126.96.36.199/22 deny from http://188.8.131.52/19 allow from all)
The “Deny” will block the block IP address that you don’t want the traffic to come from it. The rest of the countries can view your site normally, but the mentioned IP address is blocked.
order allow, deny deny from http://184.108.40.206/22 deny from http://220.127.116.11/19 allow from all
Now, if you want to allow specified traffic from selected countries, then you can use the below codes.
order deny, allow deny from all allow from 18.104.22.168
The “allow from IP address” will allow the specific country only, while the rest of the world is blocked to access the site.
You may also like
- How to change link color in WordPress?
- How to Display Breadcrumb Navigation Links in WordPress?
- How to Add Expires Headers To Your WordPress Website?
- How to Remove WordPress Version Number?
- How to Change Background Color in WordPress?
- How to Redirect your 404 pages to the Home Page in WordPress?
- How to Edit wp-config.php File in WordPress?