jrd Posted April 17, 2006 Posted April 17, 2006 Hi, I'm trying to restrict access to content in a folder to only visitors from a certain IP address. I've been told to include the following code in a .htaccess file in that folder: <FilesMatch "\.(rss|rdf|xml)$"> order allow,deny allow from 216.88.179. allow from from 68.32.175. deny from all </FilesMatch> However, when I upload that .htaccess file to that folder, nothing happens -- anyone can still access that folder. any one have any suggestions? Quote
TCH-Bruce Posted April 17, 2006 Posted April 17, 2006 Do you have a typo in your second allow from? Try reversing the order. ><FilesMatch "\.(rss|rdf|xml)$"> order deny,allow deny from all allow from 216.88.179. allow from 68.32.175. </FilesMatch> Quote
TCH-Bruce Posted April 17, 2006 Posted April 17, 2006 This will not block access to a folder but access to files ending in those extensions. Is that what you are trying to do? Quote
jrd Posted April 17, 2006 Author Posted April 17, 2006 This will not block access to a folder but access to files ending in those extensions. Is that what you are trying to do? Yes, sorry. but that isn't working. Quote
jrd Posted April 17, 2006 Author Posted April 17, 2006 As a test, I tried this: <FilesMatch "\.(rss|rdf|xml)$"> order deny,allow deny from all </FilesMatch> and it still lets everyone in Quote
TCH-Tim Posted April 17, 2006 Posted April 17, 2006 I'm trying this on my own server and the code Bruce posted seems to work fine (using different IPs of course). Do you have anything else in your .htaccess? Quote
jrd Posted April 17, 2006 Author Posted April 17, 2006 I'm trying this on my own server and the code Bruce posted seems to work fine (using different IPs of course). Do you have anything else in your .htaccess? Nope -- this .htaccess is in this folder. I have a separate one in my main .html directory. Could folder or file permissions affect anything? I have them set to 755 in that folder and in the file in question. It's almost as though the .htaccess file isn't been read. This might help: Before doing this, I also tried password-protecting the directory using cpanel. That also didn't work -- even though cpanel said it was set up and an .htaccess file was created in the folder, it still let anyone access the folder without a password. So I'm wondering if there isn't a setting of some sort that's not right... Quote
TCH-Tim Posted April 17, 2006 Posted April 17, 2006 I also tried password-protecting the directory using cpanel. That also didn't work -- even though cpanel said it was set up and an .htaccess file was created in the folder, it still let anyone access the folder without a password. You might want to open a help desk ticket and have one of the techs take a look. Quote
TCH-JimE Posted April 18, 2006 Posted April 18, 2006 As TCH-Tim says, open a support ticket for this issue please. JimE Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.