Php Htaccess中无效文件扩展名的Htaccess rewrite权限
我不知道这个老问题,我用谷歌搜索了一个小时,但我找不到解决办法 在htaccess中,当文件无效时,我们可以重定向404(设计的,不是默认的) 例如:Php Htaccess中无效文件扩展名的Htaccess rewrite权限,php,.htaccess,mod-rewrite,redirect,url-redirection,Php,.htaccess,Mod Rewrite,Redirect,Url Redirection,我不知道这个老问题,我用谷歌搜索了一个小时,但我找不到解决办法 在htaccess中,当文件无效时,我们可以重定向404(设计的,不是默认的) 例如: https://www.example.com/tedgfsst.php https://www.example.com/tedgfsst.eg 如果输入的文件扩展名无效,则需要重定向404页 例如: https://www.example.com/tedgfsst.php https://www.example.com/tedgfsst.
https://www.example.com/tedgfsst.php
https://www.example.com/tedgfsst.eg
如果输入的文件扩展名无效,则需要重定向404页
例如:
https://www.example.com/tedgfsst.php
https://www.example.com/tedgfsst.eg
或
最后,我得到了重写无效文件扩展名重定向到404错误页面的答案
RewriteCond %{REQUEST_URI} /|(/[^.]*|[a-z]|[0-9]\.(php|html?|feed|pdf|vcf|raw))$ [NC]
你有htaccess指令吗?