title: Dynamic URL rewriting using .htaccess
body: <p>I'm having some trouble with rewriting dynamic URLs using .htaccess. The rewrite should be fairly simple, but I'm missing something and would greatly appreciate a hand.</p>
  
  <p>The URL scheme:</p>
  
  <pre><code>http://www.example.com/index.php?p=/category/page-slug
  </code></pre>
  
  <p>should translate to:</p>
  
  <pre><code>http://www.example.com/category/page-slug
  </code></pre>
  
  <p>And </p>
  
  <pre><code>http://www.example.com/index.php?p=/category/&amp;f=feed/rss
  </code></pre>
  
  <p>should become:</p>
  
  <pre><code>http://www.example.com/category/feed/rss
  </code></pre>
  
  <p>My current rewrite rule is:</p>
  
  <pre><code>RewriteRule ^(.+)?$ index.php?p=$1 [NC,L]
  </code></pre>
  
  <p>but that isn't working as it should. Any suggestions?</p>
  
  <p><strong>Edit</strong>:
  This rule is now partially working as it loads the page, but none of the page assets like my stylesheets and images are showing. I'm guessing it's because they are relative paths. Any ideas on a workaround?</p>
  
  <pre><code>RewriteRule ^([a-zA-Z0-9-/+]+)$ http://example.com/index.php?p=/$1 [L]
  </code></pre>