Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.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
Apache 如何去掉.htaccess中的.php扩展名_Apache_.htaccess_Mod Rewrite - Fatal编程技术网

Apache 如何去掉.htaccess中的.php扩展名

Apache 如何去掉.htaccess中的.php扩展名,apache,.htaccess,mod-rewrite,Apache,.htaccess,Mod Rewrite,我正试图在我的.htaccess中执行mod rewrite,以摆脱“.php”文件扩展名 基本上,这是我现在的网站: 以下是我想要的: 在my.htaccess中,是否有方法使用mod rewrite执行此操作?非常感谢 我想出来了!如果您希望将此扩展用于“.html”扩展,则应将“.php”更改为“.html” 排队的人-d检查它是否不是一个目录,带有-f的行检查请求的文件是否是一个.php文件 要显示此内容,您需要如下链接: <a href="http://www.example.c

我正试图在我的
.htaccess
中执行
mod rewrite
,以摆脱“.php”文件扩展名

基本上,这是我现在的网站:

以下是我想要的:


在my.htaccess中,是否有方法使用
mod rewrite
执行此操作?非常感谢

我想出来了!如果您希望将此扩展用于“.html”扩展,则应将“.php”更改为“.html”

排队的人-d检查它是否不是一个目录,带有-f的行检查请求的文件是否是一个.php文件

要显示此内容,您需要如下链接:

<a href="http://www.example.com/about"></a>

而不是:

<a href="http://www.example.com/about.php"></a>

因为这样它只会将URL显示为about.php

希望这有助于任何希望这样做的人

<a href="http://www.example.com/about.php"></a>