'Apache re_write rule to stop html header reply
I have searched for two hours and can't ask the right question to get an answer. Maybe there is no solution. On an Apache Server when you do a mod_rewrite as below
RewriteEngine On
RewriteCond %{QUERY_STRING} !lock=9876044
RewriteRule ^ - [L,R=404]
ErrorDocument 404 "Get out of my server, you are Trespassing!!"
It will reply with the 404 messages if the query string is not correct.
This has stopped all traffic accessing the web pages except for me, which is what I want, but I want the server to not return a header and do a disconnect from the unwanted client instead of a redirect or error page.
This is a private server to which I don't want anyone having access but myself or someone I give a query string to. If there is a better way to do this please advise.
Please don't recommend anything like Fail2ban. I want the server to be invisible.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
