title: Rewrite to relative path in Apache2 on Mac OS X Lion (10.7)
body: <p>I've searched the site thoroughly and Googled for this as well, but to no avail.
  I use Apache2 + PHP on my Mac OS X.
  I haven't changed much of the configuration on any of them, just enough to get everything working correctly.
  Here's my <code>.htaccess</code> file:</p>
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  
  Options +FollowSymLinks
  Options +Indexes
  
  RewriteBase /~milad/mysite/
  
  RewriteEngine On
  
  RewriteRule ^$ index.php?:url [L,QSA] #Handling tail with no parameters
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*?)$ index.php?:url=$1 [L,QSA]
  
  &lt;/IfModule&gt;
  </code></pre>
  <p>This works just fine for all the files located at <code>http://localhost/~milad/mysite/*</code>.
  But I want to make my <code>.htaccess</code> file independent of my installation's particulars, i.e., I don't want to have to include the <code>RewriteBase ...</code> line in my code.</p>
  <p>But when I remove that line, Apache tries to map it to a URL which I don't understand.
  What I get is:</p>
  <blockquote>
  <p>Not Found</p>
  <p>The requested URL /Users/milad/Sites/newave/index.php was not found on this server.</p>
  </blockquote>
  <p>which is just ridiculous, because the <code>index.php</code> file is JUST where that URI is pointing to.
  Anyway, when I try to rewrite to <code>/index.php</code> instead of <code>index.php</code>, I find that it is being rewritten to <code>http://localhost/index.php</code>. So how is it that I can't use just the relative path, or just use <code>./index.php</code> (Yes, I've tried that, too).</p>
  <p>Any insight would be greatly appreciated.</p>