I need to redirect all requests on an Apache 2.2 server for any directory that gives a 403 to a 404 not found.
Ex:
/xyz
or/xyz/
throws a 403 -> redirect to 404/xyz/sometext.txt
returns normally.
Looking around, I came across this post:
Problem redirecting 403 Forbidden to 404 Not Found
RedirectMatch 404 ^/include(/?|/.*)$
/include 404 (instead of 403)
/include/ 404
/include/config.inc 404 (instead of 403)
However, the last case for that also returns a 404. Also, it only affects /include/ directory, I was looking more for any forbidden directory. So far I have:
RedirectMatch 404 ^[\/[\w+]]+\/$
Anyone have an idea of how to accomplish this? Thanks,