我遇到了.htaccess和PHP文件在子文件夾中的問題。我試圖實現的目的是防止任何人能夠訪問我的子文件夾中的任何文件 - 但我希望我的index.php能夠訪問這些文件。.htaccess - 拒絕訪問文件夾,但允許通過index.php訪問文件
DOCROOT/subfolder -> www.somewebsite.com/subfolder/somefile.php
-> Access Denied
但
[index.php]
<form action="/subfolder/somefile.php">
...
</form>
-> Success!
我很想只要使用的.htaccess來解決這個問題。我試過deny from all
以及一些RewriteRule
,但這些規則也會終止來自index.php的任何請求。 我試圖
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from somewebsite.com
Satisfy Any
但是從index.php文件的請求被拒絕。任何人都可以幫忙嗎?
不工作。從URL中阻止並通過index.php訪問。 – Urmir 2014-11-04 19:03:22