Welcome to WebmasterWorld Guest from 54.80.97.221

Forum Moderators: Ocean10000 & incrediBILL & phranque

Blocking IPs: htaccess vs cPanel IP Blocker

     
12:55 pm on Apr 24, 2018 (gmt 0)

Full Member from CA 

Top Contributors Of The Month

joined:Feb 7, 2017
posts: 330
votes: 23


I am currently using htaccess and SetEnvIf to block for a harem of sites on my shared server hosting account. I also have an IP Blocker from cPanel.

Is there any benefit of using the cPanel IP Blocker? For simplicity I would rather manage with only my htaccess. Are the error messages the same (403 vs 500)? Any advice?

Thanks to all for all the help and advice in the past, and with the humour that you put into your posts.
1:48 pm on Apr 24, 2018 (gmt 0)

New User from CA 

joined:July 9, 2017
posts:39
votes: 2


My experience :
Entering IPs through cPanel results in Order Deny,Allow entries in your htaccess file, which give a 403 response to the "visitors". If you enter them manually (using Order Deny,Allow) in your htaccess file, cPanel recongnizes them and you can see the same list at cPanel's IP Blocker screen.

I don't know if cPanel would recognize manually entered SetEnvIf commands in htaccess, though I'm sure the server would act on them no matter how they were entered.
2:00 pm on Apr 24, 2018 (gmt 0)

Full Member from CA 

Top Contributors Of The Month

joined:Feb 7, 2017
posts: 330
votes: 23


On my cpanel IP Blocker screen I have IP ranges that are duplicates of my htaccess ranges. I tried to delete these entries from the IP Blocker screen but the delete function does not seem to work. I detete, receive no error message but upon refresh the range is still there. Is this because it is a copy from my htaccess?

I don't recall putting in all these IP ranges into my IP Blocker screen, but maybe this is, yet another, senior moment?
8:28 pm on Apr 24, 2018 (gmt 0)

New User from CA 

joined:July 9, 2017
posts:39
votes: 2


Hi, TorontoBoy,
Are you on a hosting service?
The blocked ranges might have been put there by the techs at your hosting service, and it might be according to your terms of service with them whether or not you can tinker with the htaccess file. That might explain the persistence of the blocked ranges.
When you edit htaccess, do you do it on your own computer and ftp it to the server, or do you use the cPanel's File Manager to access it? I have done it both ways and don't recall any difference, but there might be exceptions. (I usually edit on my own and upload it, so I have my own copy.)
Can't comment on those senior moments as I have too many of them myself. (I now keep a log of anything funny I notice in the server logs and literally *everything* that I do to htaccess.) :-)
... Martin
(near Ottawa)
8:41 pm on Apr 24, 2018 (gmt 0)

Full Member from CA 

Top Contributors Of The Month

joined:Feb 7, 2017
posts: 330
votes: 23


@Martin I'm on a shared US hosting service. I edit my htaccess on my computer, then run a script to filter out all comments, then FTP up. My host provider tech is telling me that the cPanel IP Blocker can only block a set amount of IP lines. If I wish to use the cPanel IP blocker I will need to remove my custom htaccess, and replace it with their default htaccess, which is much smaller. This does not sound correct, but I don't know any different.

Thanks for the input and info.
10:28 pm on Apr 24, 2018 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:14712
votes: 614


My stock reply here is: Never do something in multiple places that can be done in a single place. Since you are comfortable editing your own htaccess, do so.

Error messages for a given error code will be the same, assuming your personal htaccess has the appropriate ErrorDocument directives (or you're using the host's default names for your custom 403 pages).

I remain worried about the 500 responses, because those are generally bona fide errors--i.e. someone made a mistake--which should not be happening at all. (If your host intentionally returns a 500 on certain blocked requests, I do not want to know about it.) But I guess that was a different thread.
12:37 am on Apr 25, 2018 (gmt 0)

New User from CA 

joined:July 9, 2017
posts:39
votes: 2


@TorontoBoy, I have never noticed, nor been advised of, a limit in the number of entries through cPanel's IP Blocker, but have never tested it for that either. Maybe your hosting service's policy is a local one, as my own htaccess and the IP Blocker at my hosting service seem to co-exist quite happily.

And if @Lucy24's advice is good (as it there were any doubt!) then we should both continue doing what we are doing.
1:25 am on Apr 25, 2018 (gmt 0)

Full Member from CA 

Top Contributors Of The Month

joined:Feb 7, 2017
posts: 330
votes: 23


I am sure glad I asked about the difference between error 403 and error 500. Thank you both. I continue to learn. I will endeavour to find out why I have sporadic error 500s, and try to correct them.
1:59 am on Apr 25, 2018 (gmt 0)

New User from CA 

joined:July 9, 2017
posts:39
votes: 2


Same here, and a Big Thanks to everyone who has "nursed" me along. My problem is to remember everything that I have "learned".
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members