你好我不太了解.htaccess
配置,但我想限制访问我的web服务器上的php文件,我想只有index.php
参数可访问。为子目录配置.htaccess
我的文件在子文件夹中,如:www.mydomain.com/sub/index.php
。我想有权在子文件夹,css文件和js文件中打开index.php
。
这里是我的配置我到目前为止有:
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
<Files /index.php>
Order Allow,Deny
Allow from all
</Files>
<FilesMatch "*\.(css|js)$">
Order Allow,Deny
Allow from all
</FilesMatch>
我试图做类似<Files sub/index.php>
但每次它限制所有PHP文件中的子文件夹和www.mydomain.com/index.php
工作正常。
任何人都可以帮助我吗?
为什么你觉得这比的.htaccess一个更好的办法?这是更多的工作,它很容易出错,它只适用于PHP文件。 – alexis