I need to block access to my site by IP address, but for some reason when I use the following I have error 500.
here is what I am trying to use:
#Deny Access to Adsense SPAM
Order Deny,Allow
deny from 209.51.197.0/24; # XLHOST IP
deny from 209.190.121.32/27; #XLHOST IP
deny from 209.190.0.0/17; # XLHOST IP
deny from 173.45.64.0/18; # XLHOST IP
deny from 64.79.64.0/19; # XLHOST IP
deny from 64.79.89.0/19; # XLHOST IP
deny from 64.79.85.0/19; # XLHOST IP
allow from all
Please help
Try without ;
#Deny Access to Adsense SPAM
Order Deny,Allow
deny from 209.51.197.0/24 # XLHOST IP
deny from 209.190.121.32/27 #XLHOST IP
deny from 209.190.0.0/17 # XLHOST IP
deny from 173.45.64.0/18 # XLHOST IP
deny from 64.79.64.0/19 # XLHOST IP
deny from 64.79.89.0/19 # XLHOST IP
deny from 64.79.85.0/19 # XLHOST IP
allow from all
xlhost com inc uses the firefox version 27.
Put this code in your htaccess:
RewriteCond %{HTTP_USER_AGENT} Firefox/27\.0 [NC]
RewriteRule .* - [F,L]
Source webmaster.net
Related
I need to modify and combine some .htaccess rules, in order to meet 3 separate conditions:
Allow access from certain IP ranges, deny the rest
Allow googlebot, no matter what IP
All this applies only to any URL containing 'theword'
<Directory "containing *theword*">
Order allow,deny
Deny from all
Allow from 192.168.0.2
Allow from 10.0.0.1
</Directory>
<Files "containing *theword*">
Order allow,deny
Deny from all
Allow from 192.168.0.2
Allow from 10.0.0.1
</Files>
I need help formatting rule with the files/directories containing theword and add exception for the googlebot.
How can I stop these IP addresses from hitting my site (185...* and 93.127..).
I have tried these in .htaccess:
Order Allow,Deny
Deny from 185.162.0.0/15
Deny from 185.164.0.0/14
Deny from 185.168.0.0/13
Deny from 185.176.0.0/12
Deny from 185.192.0.0/11
Deny from 93.127.0.0/16
Allow from all
and bots from http://tab-studio.com/en/blocking-robots-on-your-page/ but I continue to be hit.
Good: Edit (or create) the .htaccess file in the root of your server and put the following code:
order allow, deny
deny from 210.140.98.160
deny from 69.197.132.70
deny from 74.14.13.236
allow from all
I have .htaccess file for wordpress. There is code
<Files wp-login.php>
order deny,allow
deny from all
allow from 46.61.xxx
allow from 91.211.xxx
allow from 176.14.xxx
</files>
2 of these ip - works, i.e. i can enter from 46.61.xxx and 176.14.xxx, but i can't enter from 91.211.xxx. What problem could it be?
Give it a try without those xxx's, check the apache documentation
<Files wp-login.php>
order deny,allow
deny from all
allow from 46.61
allow from 91.211
allow from 176.14
</files>
I've recently upgraded a web app and I want to combine the new and old htaccess into one file. Here is my new htaccess:
<Files ~ "\.inc$">
Order allow,deny
Deny from all
</Files>
And my old htaccess:
order deny,allow
deny from all
Allow from 12.34.567.89
Allow from 12.34.567.88
My end goal is that No One can access the *.inc but only the approved IPs can access the rest of the folder.
Can I just concatenate these two rules in one file?
Yes you can use:
order deny,allow
deny from all
Allow from 12.34.567.89
Allow from 12.34.567.88
<Files ~ "\.inc$">
Order allow,deny
Deny from all
</Files>
I have generated blocked some country list on ip2location for .htaccess file.Everything it's ok but if I blocked my country ,how can I access on my computer in my country? Do you have any idea for .htaccess settings?
<Limit GET HEAD POST>
order allow,deny
allow from all
deny from 1.0.1.0/24
deny from 1.0.2.0/23
deny from 1.0.8.0/21
</Limit>