Comment on CVE StuffingparentComments−pixl975yIs there a way to return a custom 404 error handler for .git and a different one for a regular 404 in Apache? Never tried that before.−TonyTrapp5yCheck the ErrorDocument directive for .htaccess files.−hnlmorg5yThat directive doesn't have to reside in .htaccess files. It works just as well inside a Directory, Virtual Host and Server contexts as well. ErrorDocument 404 /404.php <Directory "/.git"> ErrorDocument 404 "Ah ah ah! You didn't say the magic word" </Directory> https://httpd.apache.org/docs/2.4/mod/core.html#errordocumen...
Comments
Is there a way to return a custom 404 error handler for .git and a different one for a regular 404 in Apache? Never tried that before.
Check the ErrorDocument directive for .htaccess files.
That directive doesn't have to reside in .htaccess files. It works just as well inside a Directory, Virtual Host and Server contexts as well.
https://httpd.apache.org/docs/2.4/mod/core.html#errordocumen...