如何在nginx中删除.php和.html扩展名,但使.php显示404

myzjeezk  于 2023-03-29  发布在  Nginx
关注(0)|答案(1)|浏览(97)

那么如何在nginx中删除.php和.html扩展名呢?
例如:https://example.com/example.php应重定向到https://example.com/example
https://example.com/example1.html应重定向到https://example.com/example1
还有我如何使example.php成为一个404,但示例显示example.php?

5ktev3wc

5ktev3wc1#

我用的是无扩展的PHP,现在可以用了。

相关问题