title: .htaccess RewriteRule directory
body: <pre><code>RewriteRule ^(.*)/?$ ./view.php?id=$1
  </code></pre>
  
  <p>This works if say an id = "abc123", I can access <code>www.site.com/abc123</code> perfectly fine.</p>
  
  <p>But I want to be able to access with <code>www.site.com/view/abc123</code></p>
  
  <p>So I tried:</p>
  
  <pre><code>RewriteRule ^view/(.*)/?$ ./view.php?id=$1
  </code></pre>
  
  <p>But to no avail. When I try to access <code>www.site.com/view/abc123</code> it seems as if it doesn't even grab the <code>$_GET</code> request to get the id.
  What's wrong?</p>
  
  <p>My entire .htaccess:</p>
  
  <pre><code>RewriteEngine On
  RewriteBase /~user/sitetest/
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^view/(.+?)/?$ view.php?id=$1
  </code></pre>
  
  <p>Edit:</p>
  
  <p>Using the above .htaccess, when I access:
  <code>http://localhost/~user/sitetest/view/abc123</code></p>
  
  <p>It doesn't load the $_GET[] from view.php. I even tried echoing out $_GET[] but it shows up as blank.</p>
  
  <p>If I edit it to be <code>RewriteRule ^(.+?)/?$ view.php?id=$1</code>
  And access <code>http://localhost/~user/sitetest/abc123</code> it works fine.</p>
  
  <p>If I edit it to be <code>RewriteRule ^view-(.+?)/?$ view.php?id=$1</code>
  And access <code>http://localhost/~user/sitetest/view-abc123</code> it works fine.</p>
  
  <p>Does it have something to do with the slash??</p>