Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.Htaccess块直接访问php文件_.htaccess - Fatal编程技术网

.Htaccess块直接访问php文件

.Htaccess块直接访问php文件,.htaccess,.htaccess,我有一些php文件,我不希望有人在iframe上查看和直接访问,所以我编写了一个代码,阻止其他网站在iframe中查看,只有我的网站可以iframe这些php文件 RewriteEngine On RewriteCond %{QUERY_STRING} !^id=[^&]+ [NC] RewriteCond %{HTTP_REFERER} . RewriteCond %{HTTP_REFERER} !example\.com [NC] RewriteRule .* index.html

我有一些php文件,我不希望有人在iframe上查看和直接访问,所以我编写了一个代码,阻止其他网站在iframe中查看,只有我的网站可以iframe这些php文件

RewriteEngine On
RewriteCond %{QUERY_STRING} !^id=[^&]+ [NC]
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !example\.com [NC]
RewriteRule .* index.html [L,QSA]
所以这里只有example.com可以在iframe上查看这些php文件(这很有效) 但是我如何阻止用户直接查看php文件呢