Using htaccess to block port in apache?
Is it possible?
In order to have Apache process the .htaccess
file's directives the port needed to be open, and a client needed to connect to it.
What you might be looking for is using iptables to block the port.
You theoretically CAN use rewrite rules in .htaccess using the %{SERVER_PORT}
variable to do something different with requests coming in on a specific port, which could also mean denying access to resources.
However, this is almost certainly not the best way to get to what you're trying to accomplish.