title: htaccess, redirect virtual subdomain to URL parameter
body: <p>I have a .ne.ro domain (registered in Romania) where visitors can enter with or without 'www':</p>
  
  <p><code>http://mydomain.ne.ro</code><br>
  <code>http://www.mydomain.ne.ro</code></p>
  
  <p>I want to redirect <code>http://123.mydomain.ne.ro</code> to <code>http://mydomain.ne.ro?id=123</code>. If visitor enter with 'www|mail|ftp' must be treated as non parameter (obviously).</p>
  
  <p>I tried <a href="https://stackoverflow.com/questions/1133106/htaccess-subdomain-redirct-with-last-url-parameter">htaccess subdomain redirct with last url parameter</a> but didn't work.</p>
  
  <p>Current code:</p>
  
  <pre><code># edited on 05/April/2011 as suggested:
  RewriteEngine on
  RewriteCond %{HTTP_HOST} !^www\.mydomain\.ne\.ro$
  RewriteCond %{HTTP_HOST} ^(.*)\.mydomain\.ne\.ro$
  RewriteRule ^$ /index.php?id=%1 [R,L]
  </code></pre>
  
  <p><hr/>
  <em>Hosted on a <a href="http://www.hostgator.com/shared.shtml" rel="nofollow noreferrer">hostgator's business plan</a> (linux) and registered at <a href="http://nic.ro" rel="nofollow noreferrer">nic.ro</a>, just if asking.</em></p>