title: How to protect spammers to apache?
body: <p>I have the following for <code>www.domain.com</code> and <code>login.domain.com</code>. But spammers forward there site to <code>login.domain.com</code> and it works. How can I block them?</p>
  
  <p>Ex: <code>http://spammerexmaple.sex.com</code> opens <code>http://login.domain.com</code> (I want to block this)</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
   ServerName login.domain.com
   ServerAlias login.domain.com
   DocumentRoot /var/www/html/com/public
   &lt;Directory /var/www/html/com/public&gt;
          #AddDefaultCharset utf-8
          DirectoryIndex index.php
          AllowOverride All
          Order allow,deny
          Allow from all
   &lt;/Directory&gt;
  
  &lt;/VirtualHost&gt;
  
  
  &lt;VirtualHost *:80&gt;
   ServerName www.domain.com
   ServerAlias domain.com
   DocumentRoot /var/www/html/www/public
   &lt;Directory /var/www/html/www/public&gt;
      # Compress output
      AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript
      BrowserMatch ^Mozilla/4 gzip-only-text/html
      BrowserMatch ^Mozilla/4.0[678] no-gzip
      BrowserMatch bMSIE !no-gzip !gzip-only-text/html
  
          #AddDefaultCharset utf-8
          DirectoryIndex index.php
          AllowOverride All
          Order allow,deny
          Allow from all
   &lt;/Directory&gt;
  
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p><strong>Follow up:</strong></p>
  
  <p>Spammers forward <code>www.spammer.com</code> to <code>login.domain.com</code> or <code>www.spammer.sex.com</code> anything someone can forward to <code>login.domain.com</code> and it works.</p>
  
  <p>How can I block this?</p>
  
  <pre><code>[root@d dd.dd.com]# httpd -S
  VirtualHost configuration:
  wildcard NameVirtualHosts and _default_ servers:
  _default_:443          d (/etc/httpd/conf.d/ssl.conf:81)
  *:80                   is a NameVirtualHost
           default server dummy.com (/etc/httpd/conf/httpd.conf:1028)
           port 80 namevhost dummy.com (/etc/httpd/conf/httpd.conf:1028)
           port 80 namevhost dd.dd.com (/etc/httpd/conf/httpd.conf:1039)
           port 80 namevhost aa.aa.com (/etc/httpd/conf/httpd.conf:1058)
  Syntax OK
  
  
  
  
  
  &lt;VirtualHost *:80&gt;
   ServerName dummy.com
   DocumentRoot /tmp
   &lt;Directory /tmp&gt;
          deny from all
   &lt;/Directory&gt;
  
  &lt;/VirtualHost&gt;
  
  &lt;VirtualHost *:80&gt;
   ServerName dd.dd.com
   #ServerAlias dd.dd.com
   DocumentRoot /var/www/html/dd.dd.com/public
   &lt;Directory /var/www/html/dd.dd.com/public&gt;
          #AddDefaultCharset utf-8
          DirectoryIndex index.php
          AllowOverride All
          Order allow,deny
          Allow from all
   &lt;/Directory&gt;
  
  &lt;/VirtualHost&gt;
  
  
  &lt;VirtualHost *:80&gt;
   ServerName aa.aa.com
   ServerAlias aa.com
   DocumentRoot /var/www/html/aa.aa.com/public
   &lt;Directory /var/www/html/aa.aa.com/public&gt;
      # Compress output
      AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript
      BrowserMatch ^Mozilla/4 gzip-only-text/html
      BrowserMatch ^Mozilla/4.0[678] no-gzip
      BrowserMatch bMSIE !no-gzip !gzip-only-text/html
  
          #AddDefaultCharset utf-8
          DirectoryIndex index.php
          AllowOverride All
          Order allow,deny
          Allow from all
   &lt;/Directory&gt;
  </code></pre>