title: RewriteRule for multiple robots.txt
body: <p>I have a site with multiple domains and i need a robots.txt for each domain.</p>
  
  <p>For example:</p>
  
  <pre><code>example.com will have robots-com.txt
  example.se will have robots-org.txt
  example.co.uk will have robots-co.uk.txt
  </code></pre>
  
  <p>etc...
  And the URL would be example.com/robots.txt</p>
  
  <p>So I wrote this:</p>
  
  <pre><code>RewriteRule ^.*example\.(.*)/robots\.txt robots-$1.txt [L]
  </code></pre>
  
  <p>(i thought) that it would take the domain and add it to the end of the robots file.
  But it doesn't work.</p>
  
  <p>How should I do, is it possible?</p>
  
  <hr>
  
  <p>I rewrote it like this, still doesn't work:</p>
  
  <pre><code>RewriteCond %{HTTP-HOST} ^.*example\.(.*)$
  RewriteRule ^robots\.txt$ robots-%1\.txt [L]
  </code></pre>
  
  <hr>
  
  <p><strong>Working solution:</strong>:</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} ^.*example\.(.*)$
  RewriteRule ^robots\.txt$ /robots-%1\.txt [L]
  </code></pre>