Help securing files access with htaccess and php?

后端 未结 3 1065
星月不相逢
星月不相逢 2020-12-22 02:25

I\'m working on a site that allows users to purchase digital content and have implemented a method that attempts to serve secure downloads.

I\'m using CodeIgniter to

3条回答
  •  长情又很酷
    2020-12-22 02:58

    .htaccess should look like this if you want them to only be downloadable from your localhost. Also, it removes some handlers that that could try to access any of the files, just in case. So that way only you have access to it. Also a good idea to store an index.php file in there that checks the existance of another file, and if exists, set the header, if not, exit.

    .htaccess file:

    
        Order Deny,Allow
        Deny from all
        Allow from localhost
    
    
    RemoveHandler .php .php3 .phtml .cgi .fcgi .pl .fpl .shtml
    

提交回复
热议问题