Php 默认404错误页而不是自定义?
此页面返回默认404页面的原因:Php 默认404错误页而不是自定义?,php,apache,redirect,http-status-code-404,Php,Apache,Redirect,Http Status Code 404,此页面返回默认404页面的原因:http://example.com/this%2Fthis 但是这个返回自定义的:http://example.com/this/this 这个函数还返回自定义函数:http://example.com/?i=this%2Fthis 这是我的htaccess文件: ErrorDocument 404 http://example.com/?id=error 在htaccess中,我明确指定了所有错误都应该重定向到的页面。在第一种情况下,我得到的是默认错误页,而
http://example.com/this%2Fthis
但是这个返回自定义的:
http://example.com/this/this
这个函数还返回自定义函数:
http://example.com/?i=this%2Fthis
这是我的htaccess文件:
ErrorDocument 404 http://example.com/?id=error
在htaccess中,我明确指定了所有错误都应该重定向到的页面。在第一种情况下,我得到的是默认错误页,而不是自定义错误页
问题是,为了让url正常工作并重定向到自定义错误页面,我必须向htaccess文件中添加什么?此行为是出于安全原因 由于安全原因,包含
%2f
或%5c
字符的URL只需从Apache
返回默认的404
@阿努巴瓦:是的,上面这一行是我的完整.htaccess,这是因为
%2F
在查询字符串中,而不是在主URI中