[英]htaccess - disallow direct access to all files except logged in users (PHP)
[英].htaccess: Disallow PHP files to access anything outside their directory
在.htaccess上,如何不使用open_basebdir()禁止PHP文件訪問其目錄之外的任何內容?
基本上,我將生成.htaccess文件到一些無法在自身外部進行交互的動態創建的子目錄中。
編輯:對不起,我的意思是訪問,而不是移動。
.htaccess
文件適用於Apache,而不適用於PHP。
您想要做的聽起來更像是VirtualHost的工作。
php甚至不知道您的.htaccess文件是否存在,因此它們無法避免任何腳本移動任何文件
像這樣嗎
<FilesMatch "^php5?\.(ini|cgi)$">
Order Deny,Allow
Deny from All
Allow from #Root dir of your php file
</FilesMatch>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.