.Htaccess块直接访问php文件
我有一些php文件,我不希望有人在iframe上查看和直接访问,所以我编写了一个代码,阻止其他网站在iframe中查看,只有我的网站可以iframe这些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
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文件呢