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 .htaccess重写规则在名为autoindex的cpanle错误日志中出错:错误_Php_.htaccess_Server_Cpanel - Fatal编程技术网

Php .htaccess重写规则在名为autoindex的cpanle错误日志中出错:错误

Php .htaccess重写规则在名为autoindex的cpanle错误日志中出错:错误,php,.htaccess,server,cpanel,Php,.htaccess,Server,Cpanel,这个错误在我的c语言服务器中一次又一次地重复。htaccess代码是这样的,下面是我在cpanel中添加错误的代码 <IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule> <IfModule dir_module> DirectoryIndex index.html index.php </IfModule> <IfModule !mo

这个错误在我的c语言服务器中一次又一次地重复。htaccess代码是这样的,下面是我在cpanel中添加错误的代码

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>

<IfModule !mod_authz_host.c>
Satisfy any
</IfModule>

RewriteEngine on
AddDefaultCharset Off

RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

你可以从一个更好的题目开始,“有人能帮我解决这个问题吗?”可以应用到每个帖子,并且是多余的,没有描述你的问题

我也希望您的
.htaccess
中的引号不是文件的一部分

错误消息已经说明了问题所在
index.html
index.php
不在目录中,并且生成文件列表(服务器生成的目录索引)被禁用

编辑


基于对某些目录的评论,似乎更好的问题是“什么试图引用
/ico
目录而不是该目录中的文件?”

但是一些html文件夹(如img和css)没有index.html或index.php文件,因此如何禁用需要写入的规则。htaccess您可以从描述想要实现的内容开始。我添加了一个关于您的问题可能是什么的猜测。我只想停止在我的服务器日志中出现自动索引错误。我上面提到的.htaccess文件中的代码如何告诉我您是否有任何可以写入.htaccess的规则来删除此错误,所以您只想删除症状,而不是原因?向目录中添加一个空的
index.html
文件。
[Sun Oct 21 07:51:15.337451 2018] [autoindex:error] [pid 2900243:tid 139861235275520] [client 207.46.13.109:6818] AH01276: Cannot serve directory /home/lkxsvek9g963/public_html/ico/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive

[Sat Oct 20 12:41:53.883794 2018] [autoindex:error] [pid 2710513:tid 139861465175808] [client 94.130.216.183:53586] AH01276: Cannot serve directory /home/lkxsvek9g963/public_html/ico/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive