Jump to content

How to et 1 or more url through my htaccess allow/disallow ip?


bambinou1980

Recommended Posts

Hello,

 

I have an htaccess file like this:


<Limit GET POST>
order allow,deny
allow from xxx.xxx.xxx.xx
</Limit>
 
Options +FollowSymLinks
 
IndexIgnore */*
 
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
 
 
<Files 403.shtml>
order deny,allow
deny from all
</Files>
allow from xxx.xxx.xxx.xx #Fred
allow from xxx.xxx.xxx.xxx #Ben

 

 

What I would like to do is now let one url pass through the ip protection, I wish to have this(or more) url public.


 

 

How to do this please?

 

Thank you,

 

Ben

Edited by Ch0cu3r
Link to comment
Share on other sites

If you only want certain ip addresses from accessing a certain file then you need to define the  allow from  directive inside a <Files></Files> block

<Files "filename-here-to-be-ip-protected.extension">
    Order deny,allow
    Deny from all
    allow from xxx.xxx.xxx.xx #Fred
    allow from xxx.xxx.xxx.xxx #Ben
</Files>

Replace filename-here-to-be-ip-protected.extension with the file you want ip protected.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.