title: Use AJAX with .htaccess redirected subdomain
body: <p>i am doing subdomain redirection with;</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.com$ [NC]
  
  RewriteCond %1 !^(www|ftp|mail)$ [NC]
  
  RewriteRule ^.*$ file.php?id=%1 [L]
  </code></pre>
  
  <p>This turns <strong>someid.domain.com</strong> to <strong>www.domain.com/file.php?id=someid</strong></p>
  
  <p>Everything is ok for now but i am having problem to use AJAX on the page which is posting variables to a file with </p>
  
  <pre><code>$.post('post.php', {ID: ID},
  </code></pre>
  
  <p>As you know AJAX wont let to use like <strong>www.domain.com/post.php</strong> but when i write <strong>post.php</strong> bec. of redirection it searches for <strong>someid.domain.com/post.php</strong></p>
  
  <p>This is what i want;</p>
  
  <p>1- Redirect <strong>someid.domain.com</strong> to <strong>www.domain.com/file.php?id=someid</strong></p>
  
  <p>2- Redirect <strong>someid.domain.com/post.php</strong> to <strong>www.domain.com/post.php</strong></p>