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
Php 意外重写_Php_.htaccess - Fatal编程技术网

Php 意外重写

Php 意外重写,php,.htaccess,Php,.htaccess,在localhost上,在我的一个文件夹中,可以访问文件,如http://localhost/folder/map而不是http://localhost/folder/map.php。这可能是因为Apache的配置有问题,但我被困在这里,什么也没想到。如果您的中有一个名为index.php或index.html的文件http://localhost/folder/mapfolder,当您只需输入目录名作为浏览器url时,Apache将运行该文件 这就是http://localhost运行页面,而

在localhost上,在我的一个文件夹中,可以访问文件,如
http://localhost/folder/map
而不是
http://localhost/folder/map.php
。这可能是因为Apache的配置有问题,但我被困在这里,什么也没想到。

如果您的
中有一个名为
index.php
index.html
的文件http://localhost/folder/map
folder,当您只需输入目录名作为浏览器url时,Apache将运行该文件

这就是
http://localhost
运行页面,而不仅仅是显示目录列表或显示空白页面


这可能是您在键入
http://localhost/folder/map
url.

您的.htaccess内容是什么?正如@userNOID建议的那样,请发布您的
.htaccess
的内容,这样我们就可以查看是否有任何规则可以做到这一点,例如,删除URL的.php扩展名的规则。这通常是设置的“错误”。my.htaccess文件为空。当我设置
选项-MultiViews
时,我得到一个500错误。@HakanAktaş您缺少一个
s
,就像在
Options+FollowSymLinks-MultiViews
中一样,也没有名为map的文件夹。