SpeedCoder
SpeedCoder

Reputation: 139

Default 404 error page instead of custom?

Why this page returns the default 404 page: http://example.com/this%2Fthis
but this one returns the custom one: http://example.com/this/this
and this one returns the custom one also: http://example.com/?i=this%2Fthis

Here is my htaccess file:

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

In my htaccess, I clearly specify the page all errors should redirect to. In the 1st case, I am getting the default error page and not my custom one.

The question is, what I must add to my htaccess file in order to have the url work properly and redirect to the custom error page?

Upvotes: 3

Views: 473

Answers (1)

anubhava
anubhava

Reputation: 785136

This behavior is due to a security reason.

URLs containing %2f OR %5c characters just return a default 404 from Apache for security reasons.

Related Apache docs

Also see: 5 Solutions to Url Encoded Slashes (%2F) Problem in Apache

Upvotes: 1

Related Questions