Q:

.htaccess limit IP range

I have a .htaccess file that limits the access of my website to an IP range.
I do it like that :
# Limite access to 160.98.xxx.xxx
<Limit GET POST>
    order deny,allow
    deny from all
    allow from 160.98.
</Limit>

But I have a "Forbidden You don't have permission to access /testip/test.txt on this server." when I tried to access it with my IP that actually begins with 160.98.
Am I doing it something wrong with the .htaccess ? It is located to the root of the website. I have generated the code of the .htaccess with http://www.toshop.com/htaccess-generator.cfm

A:

According to your comment above you request with a local address, not with the one you expected. So you have to grant access to that address to: 
# Limite access to 160.98.xxx.xxx
<Limit GET POST>
    order deny,allow
    deny from all
    allow from 160.98.
    allow from 127.0.
</Limit>

Most likely that is not your ultimate goal, but it answers the question. If you want to test if the specified address range starting with 160.98. has access, then you have to make a request from such an address. Currently you don't, since obviously you test from the same system which will always use the loopback address. 

