Let's explain what a malicious binding is.
Is someone else through ping get to your domain name IP, will own domain name also resolves to your IP up.
Why is it possible to bind like this?
Because Apache is requested, it will find the corresponding domain name in the file of the virtual domain name configuration to find the corresponding directory. So the question is, what if the requested domain name is not found in the configuration? In fact, Apache can not find the corresponding domain name configuration, the first configured virtual domain name is requested by default. This causes others to bind their domain name to someone else's server.
OK, now that we know the reason, then the following is the solution, in fact, it is very simple.
Workaround:
Modify the Apache virtual Domain configuration file httpd-vhosts.conf, add the following code
<virtualhost *:80><ifmodule mod_rewrite.c>rewriteengine onrewriterule ^/(. *) http://www.xx.com/$1 [L,R= 301] # www.xx.com is the domain URL you want to jump to </IfModule></VirtualHost>
It is important to note that the above configuration should be placed at the front, and the domain name to jump to is already configured in the configuration file, otherwise it will cause repeated redirection, resulting in the site inaccessible.
The solution to Apache's malicious parsing bindings