开发者

PHP htaccess - allow disallow

I have the following htaccess code in my include files directory to protect against direct access.

<Files *>
Deny from all
</Files>

This works fine except for one file which is used for my jquery star rating. Ratings are written to and read from a php file.

I need to modify the above htaccess code so ratings.data.php file is excluded fro开发者_C百科m the deny all.

Something Like:

<Files *>
Deny from all
    Allow ratings.data.php
</Files>

How can I accomplish this? Thank you for your help!


The Allow/Deny directive sets the clients that can access that portion of the site. So you would need to add another section with something like:

<Files ratings.data.php>
    Allow from all
</Files>

Update: Some clarification.

You need to add both sections:

<Files ratings.data.php>
    Allow from all
    Order Allow,Deny
</Files>

<Files *>
    Deny from all
    Order Deny,Allow
</Files>


Try something like this

<Files ratings.data.php>
Satisfy All  
</Files>`
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜