title: Creating SEO friendly URLs using apache mod_rewrite
body: <p>I am trying to convert my ugly URL into SEO friendly URLs using apache <code>mod_rewrite</code>.</p>
  
  <p>This is how my current <code>URL</code>s look like: </p>
  
  <pre><code>index.php?p=search
  index.php?p=contact
  index.php?p=my-account&amp;user=1
  index.php?p=my-account&amp;user=1
  </code></pre>
  
  <p>This is what I expect from rewriting: </p>
  
  <pre><code>mydomain.com/search
  mydomain.com/contact
  mydomain.com/my-account/1
  mydomain.com/my-account/1
  </code></pre>
  
  <p>If I passed one query string through my URL. I can do it in my <code>.htaccess</code> file something like this. But not sure how to do it when query string more than one in <code>URL</code>. </p>
  
  <pre><code># Create SEO friendly URL 
  # Eg: index.php?p=search to domain/search
  &lt;ifModule mod_rewrite.c&gt;
  
  # Turn on the engine:
  RewriteEngine on
  
  # Redirect certain paths to index.php:
  RewriteRule ^(search|contact)/?$ index.php?p=$1 
  
  &lt;/ifModule&gt;
  </code></pre>
  
  <p>This is working if URL has one string. 
  Can anybody tell me how I do this for more query strings. </p>
  
  <p>Thank you. </p>