0

Hello Everyone,

I need your help please, using htaccess, I like to know how to deny access to an index.php file from all visitors except me. I have tried the following;

<files index.php>
 order allow,deny
 deny from all
</files>

That works denying all access to that file. I would like an exception for my IP.

Thanks in advance.

2
Contributors
4
Replies
8
Views
5 Years
Discussion Span
Last Post by Angle90
0

Thanks broj1, however I only want to deny public access to one file "index.php" and not the entire website. I would like an exception for my ip.

0

Sory, I ommitted files directive for simplicity (but should have not :-). Will this work for you (provided that the path to index.php is correct):

<files index.php>
    order deny,allow
    deny from all
    allow from [your IP]
</files>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.