Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/266.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.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
安全HTML文件或包含PHP中HTML和PHP文件的安全文件夹(Wordpress)_Php_Wordpress_Iis_Web Config - Fatal编程技术网

安全HTML文件或包含PHP中HTML和PHP文件的安全文件夹(Wordpress)

安全HTML文件或包含PHP中HTML和PHP文件的安全文件夹(Wordpress),php,wordpress,iis,web-config,Php,Wordpress,Iis,Web Config,我开发了一个在iframe中使用HTML文件(存在于单个文件夹中)的项目。 我创建了一个index.php,需要登录才能访问,在这个index.php中,我在iframe中使用index.html。问题是,如果用户直接调用index.html,那么它可以直接看到index.html。我想限制用户直接查看index.html。我在wordpress中创建了这个项目,并将IIS用作web服务器 如果您使用的是IIS 7.x,请在文件夹中创建一个web.config文件,以限制访问,然后键入或粘贴以下

我开发了一个在iframe中使用HTML文件(存在于单个文件夹中)的项目。
我创建了一个index.php,需要登录才能访问,在这个index.php中,我在iframe中使用index.html。问题是,如果用户直接调用index.html,那么它可以直接看到index.html。我想限制用户直接查看index.html。我在wordpress中创建了这个项目,并将IIS用作web服务器

如果您使用的是IIS 7.x,请在文件夹中创建一个web.config文件,以限制访问,然后键入或粘贴以下内容。它应该是这样的:

<?xml version="1.0"?>
<configuration>
   <system.webServer>
       <security>
          <requestFiltering>
               <hiddenSegments applyToWebDAV="false">
                   <add segment="myfoldername" />
               </hiddenSegments>
           </requestFiltering>
       </security>
   </system.webServer>
</configuration>


您使用的是哪个版本的IIS?如果我在iframe中调用此文件夹中的任何文件,则这将限制该文件,或者不限制该文件,并且不允许您查看该文件,因为客户端(我指的是浏览器)将请求该文件。我不熟悉php,但您可以在应用程序上创建一个句柄,请求这些文件,然后返回html。然后可以使用此处理程序请求文件。