3 ms·
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.
by pixl97 6y ago
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.
- TonyTrapp 6y agoCheck the ErrorDocument directive for .htaccess files.
- hnlmorg 6y agoThat 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#errordocument https://httpd.apache.org/docs/2.4/mod/core.html#errordocumen...