Php .htaccess在localhost | lampp | Ubuntu上不工作

Php .htaccess在localhost | lampp | Ubuntu上不工作,php,.htaccess,mod-rewrite,ubuntu,lampp,Php,.htaccess,Mod Rewrite,Ubuntu,Lampp,我正在尝试实现url重写,以从php文件中删除php扩展名,但我无法找出问题所在! 我在ubuntu机器上使用LAMP,我甚至在httpd.conf中将AllowOverride从none设置为All: # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Option

我正在尝试实现url重写,以从php文件中删除php扩展名,但我无法找出问题所在! 我在ubuntu机器上使用LAMP,我甚至在httpd.conf中将AllowOverride从none设置为All:

# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
AllowOverride All   <--- I set it from "None" to "All"

我甚至尝试了
只是一个猜测,我会检查您需要的Apache模块是否已启用。修改


我想不出哪里出了问题你能想出什么?当你使用规则时会发生什么?您的错误日志和重写日志显示了什么?在服务器的httpd.conf上的loadmodules中是否启用了mod_重写?很抱歉我不知道,我是.htaccess的新手。正如我所说,我想从abc.php中删除.php扩展名。问题是浏览器仍然将url显示为(应该是)。再次抱歉,我不知道在哪里查找您提到的日志文件。根据当前规则,您正在添加
.php
扩展名,而不是将其删除。请先使用搜索引擎,因为这是一个使用mod_rewrite的琐碎任务,以前已经解决过几千次了。@feeela我遵循这里提到的教程:我将代码与不同的stackoverflow答案结合起来。您能使用phpinfo()编写.php扩展名删除的代码吗;apache2configuration中的“加载的模块”部分提到了“mod_重写”。很抱歉,您已经提到了这一点。我要做的是通过第三方将站点和htaccess上传到托管服务器,您自己还没有配置,看看这是htaccess问题还是apache配置问题
Options +FollowSymLinks -MultiViews

<IfModule mod_rewrite.so>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
</IfModule>