Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/77.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/4/r/78.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
检测URL中未显示.php或.html的文件夹内容_Php_Html_.htaccess_Url - Fatal编程技术网

检测URL中未显示.php或.html的文件夹内容

检测URL中未显示.php或.html的文件夹内容,php,html,.htaccess,url,Php,Html,.htaccess,Url,如何使URL以这种格式显示?但仍然有两个价值可用 例如,当我的客户单击“关于”页面的链接时,不会将他们带到文件夹的index.php,而是自动检测文件夹的.php或.html,并将其以这种格式显示在URL中 http://www.example.com/about/ 不是这样的: http://www.example.com/about/index.php 有没有一种方法可以使用.htaccess执行此操作通常,我们使用DirectoryIndex s.t DirectoryIndex in

如何使URL以这种格式显示?但仍然有两个价值可用

例如,当我的客户单击“关于”页面的链接时,不会将他们带到文件夹的index.php,而是自动检测文件夹的.php或.html,并将其以这种格式显示在URL中

http://www.example.com/about/
不是这样的:

http://www.example.com/about/index.php

有没有一种方法可以使用.htaccess执行此操作通常,我们使用DirectoryIndex s.t

DirectoryIndex index.html index.php

在.htaccess或httpd.conf.

中,即使文件名不是index.php,这是否仍然有效?它在about.php上工作吗?