Is it possible, in .htaccess, to redirect ErrorDocument requests based on their referrer?
For example user requests http://domain.com/folder1/ [which is a 404] would it be possible to redirect that request to only if it came from domain.com to https://securedomain%{REQUEST_URI} or something similar…
Thanks.
No, you cannot declare
ErrorDocumentdirective conditionally based on the value of HTTP_REFERER field.But using
RewriteRulein conjunction withRewriteCondyou could manually rewrite/point to the required file/url which will display an error page.