After search around and dont get it working as desired, I will try the luck asking here.
I have enabled mod_info.c on my Apache webserver. I can restrict the access using for example:
<Location /server-info>
SetHandler server-info
Require ip XXX.XXX.XXX.XXX
</Location>
This works, but, since I have many Virtual Hosts on same IP, all they can try access and get the error 403 - Forbidden.
This is not the problem.
My question is about how to change the 403 - Forbidden to 404 - Not Found.
This way, all badbots, scans, etc... Will think the mod is not enable, and I still can use it for specific IP or domain...
Seems Rewrite Engine inside of mod_info conf file does not allow it, example:
<Location /server-info>
SetHandler server-info
RewriteCond %{HTTP_HOST} !^myprivatedomain.local$ [NC]
RewriteRule ^ - [L,R=404]
Require ip XXX.XXX.XXX.XXX
</Location>
The code above does not return the 404 error as desired.
Someone would give me an hint about how to archive the desired goal?
Goal:
Redirect all virtual hosts and web access to 404 when looking for /server-info except for myprivatedomain.local the one I will use internally.