Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/243.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/8/.htaccess/5.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
Php 拒绝访问“我的网站”文件夹中的文件夹和内容 简而言之,我不希望用户访问文件夹或其中的数据或文件。_Php_.htaccess - Fatal编程技术网

Php 拒绝访问“我的网站”文件夹中的文件夹和内容 简而言之,我不希望用户访问文件夹或其中的数据或文件。

Php 拒绝访问“我的网站”文件夹中的文件夹和内容 简而言之,我不希望用户访问文件夹或其中的数据或文件。,php,.htaccess,Php,.htaccess,我搜索了一下,找到了deny from all,但当我把它放到ftp上时,它不起作用;但在localhost上,它可以正常工作 我在上传文件夹中编写以下给定代码: # .htaccess mod_rewrite RewriteEngine On deny from all 决议: 只需在文件夹中放入index.php文件,其中包含以下代码: <?php header("Location: ../"); ?> 它将通过用户从该文件夹中取出。您是否将文件命名为.htaccess

我搜索了一下,找到了
deny from all
,但当我把它放到ftp上时,它不起作用;但在localhost上,它可以正常工作

我在上传文件夹中编写以下给定代码:

# .htaccess mod_rewrite
RewriteEngine On

deny from all
决议:

只需在文件夹中放入index.php文件,其中包含以下代码:

<?php
header("Location: ../");
?>


它将通过用户从该文件夹中取出。

您是否将文件命名为
.htaccess