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
在xampp中自动获取php扩展_Php - Fatal编程技术网

在xampp中自动获取php扩展

在xampp中自动获取php扩展,php,Php,我正在使用xampp 保存在htdocs中的任何项目都将在http://localhost/projectname/filename.php 我想知道当我打字的时候有什么办法吗 http://localhost/projectname/filename and open that page 意味着无需在文件中写入.php扩展名(默认扩展名应为php)您可以使用mod_rewrite进行此操作。在.htaccess中: RewriteEngine on RewriteCond %{REQUES

我正在使用xampp

保存在htdocs中的任何项目都将在
http://localhost/projectname/filename.php

我想知道当我打字的时候有什么办法吗

http://localhost/projectname/filename and open that page 

意味着无需在文件中写入.php扩展名(默认扩展名应为php)

您可以使用mod_rewrite进行此操作。在
.htaccess
中:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.+) $1.php [L]

然后,您需要编辑您的httpd配置以加载mod_rewrite并使
AllowOverride FileInfo
。此外,检查错误日志将帮助您找出问题所在。[Fri Jan 22 19:48:45 2010][error][client 127.0.0.1]由于可能的配置错误,请求超出了10次内部重定向的限制。如有必要,使用“LimitInternalRecursion”增加限制。使用“LogLevel debug”获取回溯。由于可能的配置错误,referer:[Fri Jan 22 19:48:45 2010][error][client 127.0.0.1]请求超出了10个内部重定向的限制。如有必要,使用“LimitInternalRecursion”增加限制。使用“logleveldebug”获得回溯。referer:非常感谢亲爱的,它可以工作。。。现在,最后一个查询如果我在页面名称中写错了,它会显示
500 Internel server error
,但在这个htaccess文件之前,它会显示
404 not found error
谢谢,伙计,它可以工作..在这个htaccess文件之前的最后一个查询非常棒,页面未找到错误与
404页面未找到
一起出现,但现在
500 Internet服务器错误
发生在页面未找到上