title: Mod Rewrite: different domains with different languages
body: <p>I'm developing a multiple languages website. I'm using a different subdomain for each language and they're poiting to the same folder. It's the same site using .po files for translation.</p>
  
  <p>Now, I'm working with pretty urls, and I need each subdomain to have it's own set of rules.</p>
  
  <p>For example:</p>
  
  <pre><code>en.domain.com/contact
  pt.domain.com/contato
  es.domain.com/contacto
  </code></pre>
  
  <p>My simplified htaccess looks like this:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  Options -Multiviews
  RewriteEngine On
  RewriteBase /
  
  RewriteCond %{HTTP_HOST} ^en.domain.com$ [NC]
  RewriteRule ^contact/$ /contact.php 
  RewriteRule ^contact$ /contact.php [L]
  
  RewriteCond %{HTTP_HOST} ^pt.domain.com$ [NC]
  RewriteRule ^contato/$ /contact.php
  RewriteRule ^contato$ /contact.php [L]
  
  RewriteCond %{HTTP_HOST} ^es.domain.com$ [NC]
  RewriteRule ^contacto/$ /contact.php
  RewriteRule ^contacto$ /contact.php [L]
  
  
  &lt;/ifModule&gt;
  </code></pre>
  
  <p>The problem is that, if I try a custom url from one domain on another, it still works. For example, the "/contato" word in portuguese still opens the "/contact" url on the english.</p>
  
  <p>So what I want is, that each domain ONLY follows it's specif set of rules, not every single rule on the file. Any ideas?</p>