Jump to content

Recommended Posts

Posted

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?

Posted

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>

Posted
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.

Posted

As a test, I tried this:

 

<FilesMatch "\.(rss|rdf|xml)$">

order deny,allow

deny from all

</FilesMatch>

 

and it still lets everyone in

Posted

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?

Posted
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...

Posted
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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...