Reputation:
I have a website and I have configured my main .htaccess
file with this directive:
ErrorDocument 404 https://websiteLink.com
When I access a page that has a link to a nonexistent image, instead of receiving a the 404 above, I receive a 302 response with the location directive that specified in the .htaccess
configuration.
Why this 302 response generated?
Upvotes: 0
Views: 176
Reputation: 41219
This is because of the absolut url. You are using a full url in your ErrorDocument's destination. Use an absolute path
ErrorDocument 404 /path/
Upvotes: 1