title: .htaccess mod rewrite for product id
body: <p>Evening guys, </p>
  
  <p>I have been attempting to get mod rewrite working for product id's and name's but I am having no luck at all. I have tried searching here on SO but there are no clear explanations.</p>
  
  <p>This is for my ecommerce demo located <a href="http://www.peakwebdesigns.co.uk/ecommerce/store" rel="nofollow noreferrer">http://www.peakwebdesigns.co.uk/ecommerce/store</a></p>
  
  <p><strong>Example URL:</strong> <a href="http://www.peakwebdesigns.co.uk/ecommerce/product_page?id=3name=Bed" rel="nofollow noreferrer">http://www.peakwebdesigns.co.uk/ecommerce/product_page?id=3name=Bed</a></p>
  
  <p>I want: <a href="http://www.peakwebdesigns.co.uk/ecommerce/product_page?id=3name=Bed" rel="nofollow noreferrer">http://www.peakwebdesigns.co.uk/ecommerce/product_page?id=3name=Bed</a></p>
  
  <p>to be <a href="http://www.peakwebdesigns.co.uk/ecommerce/3-Bed" rel="nofollow noreferrer">http://www.peakwebdesigns.co.uk/ecommerce/3-Bed</a></p>
  
  <p>My URL is structured as follows:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;a href='product_page?id=&lt;?php echo $product_array[$key]["product_id"].'name='.$product_array[$key]["product_name"]; ?&gt;' id='product_links'&gt;&lt;?php  echo '&lt;div id="product_image"&gt;&lt;img src="images/'. $product_array[$key]["image"] . '"&gt;&lt;/div&gt;' ?&gt; &lt;/a&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>This is what I currently have in my .htaccess (I know the first few code entries work because I have removed .php and .html from files):</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>RewriteEngine On
  
  RewriteCond %{REQUEST_FILENAME} !-f
  
  RewriteRule ^([^\.]+)$ $1.php [NC,L]
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^([^\.]+)$ $1.html [NC,L]
  
  RewriteRule ^([0-9])-([A-Z]+)$ product_page?id=$1name=$2  [NC,L]</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>Question: Due to me having /ecommerce/ included in my URL is the above setup correctly?</strong></p>
  
  <p>If not, can anyone help assist me in writing this correctly?</p>
  
  <p>Thanks.
  Stan. </p>