I am trying to see if a custom error page can be sent to the browser when an invalid method is sent to the server.
In my .htaccess is this:
ErrorDocument 400 /errpages/httperror.php
ErrorDocument 401 /errpages/httperror.php
ErrorDocument 403 /errpages/httperror.php
ErrorDocument 404 /errpages/httperror.php
ErrorDocument 405 /errpages/httperror.php
RewriteEngine on
RewriteCond %{REQUEST_METHOD} !^(GET|POST) [NC]
RewriteRule .* - [R=405,L]
It works as expected, and while using Postman to create a HEAD request I receive the expected 405
response in the header.
However, what I want is the 405
error page not just the header. Is it possible to modify what I have to make that happen?