I'm defining a RewriteMap
in my Apache httpd configuration. (This is working correctly.)
RewriteMap redirects-list txt:/path/to/redirects.txt
But when the map file (/path/to/redirects.txt
) doesn't exist, the server throws an error:
RewriteMap: file for map redirects-list not found:/path/to/redirects.txt
I want to make this fault-tolerant, where the RewriteMap
is set if and only if the file exists.
(For example, if it doesn't exist, maybe there's a way to automatically use a fallback, a blank file like /dev/null
.)
I'd appreciate any help.