Htaccess to block ip
By Fahad Ahammed
- One minute read - 168 wordsWebsites are naturally geeks guinea pig . You will get much more spam if you get a website to comment or something . They just don’t stop . Try and try . You will find it very much annoying . You can pause them . Not stop but it will give you peace i think . Now open any text editor and
Type codes from below .
Now put your desired ip or ips . each in new line by that pattern . You can use 58.97.*.* to block the next ips . And save that file by .htaccess . upload that file in your websites root , maybe /public_html/ . If you have a .htaccess , then edit that file and put above codes after all codes in your .htaccess after existed codes .
Now let you want to allow a particular page or file to accessed by only a particular IP or IP range and Deny access for all other users or visitors, You have to put below codes in htaccess.