500 server error instead of 404 in plugins and theme directories


Subdirectory install of the WordPress Network doesn’t handle 404 pages correctly for plugins and theme folders.

For example If I’m trying to access non-existing theme like http://example.org/wp-content/themes/iamnothere/, I’ll get a 500 Internal server error response instead of 404 error.

Error log says: Request exceeded the limit of 10 internal redirects due to probable configuration error.

Any ideas what could cause behavior like this?