title: htaccess - Deny requests from unauthorized domains
body: <p>I have a website "www.mysite.com", and it has an its own ip. Now since few months I see several domains pointing to my ip server (it's not a shared ip). I can navigate thru the entire website with those unauthorized domains, they get indexed in google with my contents and all.</p>
  
  <p>How can i set my htaccess to allow requests only for "www.mysite.com" ?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>this is the .htaccess I've written so far with the suggestions, but somehow the first page is still served, with no images tho</p>
  
  <p>.htaccess</p>
  
  <pre><code>SetEnvIfNoCase Referer "^http://(www.)?thiefdomain.com" spam_ref  
  SetEnvIfNoCase Referer "^http://(www.)?thiefdomain2.com" spam_ref2
  
  
  &lt;FilesMatch "(.*)"&gt;  
      Order Allow,Deny  
      Allow from all  
      Deny from env=spam_ref  
      Deny from env=spam_ref2  
  &lt;/FilesMatch&gt;  
  
  RewriteEngine On  
  RewriteCond %{REQUEST_FILENAME} -s [OR]  
  RewriteCond %{REQUEST_FILENAME} -l [OR]  
  RewriteCond %{REQUEST_FILENAME} -d  
  RewriteRule ^.*$ - [NC,L]  
  RewriteRule ^.*$ index.php [NC,L]  
  </code></pre>
  
  <p>How can I avoid the first page to be displayed?</p>