404 error page error instead of custom?

Why does this page return a default 404 page: http://example.com/this%2Fthis


but this one returns a custom: http://example.com/this/this


and this one returns a custom one too:http://example.com/?i=this%2Fthis


Here is my htaccess file:

ErrorDocument 404 http://example.com/?id=error

      

In my htaccess, I clearly indicate the page to which all errors should be redirected. In the first case, I am getting the default error page, not the custom one.

The question is, what should I add to my htaccess file for the url to work properly and redirect to the custom error page?

+3


source to share


1 answer


This behavior is for security reasons.

URL-addresses that contain characters %2f

or %5c

return a default 404

of Apache

for security reasons.



Apache related docs

See also: 5 Solutions to Encode Url Code Angles (% 2F) Problem in Apache

+1


source







All Articles