htaccess 对 htaccess 中无效文件扩展名的重新编辑权限


Htaccess rewirte permission for invalid file extension in htaccess

我不知道这个老问题,我已经谷歌了一个小时,但我找不到解决方案。

在htaccess中,我们可以在无效文件时重定向404(设计,不是默认)。

例如:

https://www.example.com/tedgfsst.php

如果我输入的文件扩展名无效,则需要重定向404页面

例如:

https://www.example.com/tedgfsst.eg

https://www.example.com/tedgfsst.cr
最后,

我得到了重写无效文件扩展名重定向到404错误页面的答案。

RewriteCond %{REQUEST_URI} /|(/[^.]*|[a-z]|[0-9]'.(php|html?|feed|pdf|vcf|raw))$ [NC]