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 htaccess文件列出目录,而不是使用index.php_.htaccess_Wamp - Fatal编程技术网

.htaccess htaccess文件列出目录,而不是使用index.php

.htaccess htaccess文件列出目录,而不是使用index.php,.htaccess,wamp,.htaccess,Wamp,我正在网站上使用nanoCMS(来自mini print.com)。 以及他们提供的htaccess文件 目录结构是- cms/ error404.php htaccess-laplume.txt htaccess.txt img/ readme.txt 在进入localhost/时, 我正在获取文件列表,而不是重定向到/cms/index.php 我搞不懂! 有人能提出一些建议吗 (这是htaccess文件) 您需要将htaccess文件移动到文档根目录,否则,访问/将不会触

我正在网站上使用nanoCMS(来自mini print.com)。 以及他们提供的htaccess文件

目录结构是-

cms/
  error404.php
  htaccess-laplume.txt
  htaccess.txt
img/
  readme.txt
在进入
localhost/
时, 我正在获取文件列表,而不是重定向到
/cms/index.php

我搞不懂! 有人能提出一些建议吗

(这是htaccess文件)


您需要将htaccess文件移动到文档根目录,否则,访问
/
将不会触及
/cms/
文件夹中的任何内容

此外,您需要确保
httpd.conf文件中的
AccessFilename
设置为
htaccess.txt
。否则,您可以将
htaccess.txt
重命名为access文件名定义的任何文件名。您还应确保正在加载重写模块,该模块也应位于httpd.conf文件中,并应如下所示:

LoadModule rewrite_module modules/mod_rewrite.so

确保该行未被注释掉。

是您的文档根目录吗?您的文档根目录中是否有另一个htaccess文件?否,cms是根文件夹中的文件夹rewrite.log中有什么?应该是这样的:
RewriteCond:input='/'pattern='^/$'=>匹配的rewrite'->'/cms/index.php'与/cms/index.php的内部重定向
I无法启动rewrite.logging-获取错误-.htaccess:命令“RewriteLog”无效,可能拼写错误或由根文件夹中服务器配置htaccess文件中未包含的模块定义。但cms是根文件夹中的文件夹。和cms文件夹中的my index.php。“重写”模块正在工作(我正在其他项目中使用它)。
LoadModule rewrite_module modules/mod_rewrite.so