title: How to prevent hotlinking static files?
body: <p>I want to prevent hotlinking on my static files on a Jetty 9.3.6 server, that is to only allow my domain, my subdomains, and directly access (none referer header, such as open it directly with the url on a web browser) to view  them.</p>
  
  <p>The only thing I've found so far is <code>HeaderPatternRule</code> of the Rewrite pluggin but seems like it can only rewrite the header.</p>
  
  <p>Do you know how? Understanding I can have something in front of the Jetty server to do the work for it.</p>
  
  <p>Update: Something like this on Apache Httpd</p>
  
  <pre><code>RewriteEngine on
  RewriteCond %{HTTP_REFERER} !^$
  RewriteCond %{HTTP_REFERER} !^http://(www.)?yourwebdomain.com(/)?.*$ [NC]
  </code></pre>