title: Need to create a RewriteRule in .htaccess for a Magento website
body: <p>I am currently trying to put a RewriteRule into my .htaccess file for my Magento website that will allow me to write a category URL in the following way:</p>
  
  <pre><code>http://mydomain.com/dir/&lt;direction&gt;/order/&lt;order&gt;/&lt;Magento category URL path&gt;.html
  </code></pre>
  
  <p>What I am basically looking to do is use my robots.txt file to make some of the category URLs not appear (specifically when you apply a different sort order to the category).</p>
  
  <p>So let's assume I have the following URL:</p>
  
  <pre><code>http://mydomain.com/dir/asc/order/sales_index/footwear/mens-work-boots/motorcycle-boots.html
  </code></pre>
  
  <p>I would like that to be rendered just as if it the URL was:</p>
  
  <pre><code>http://mydomain.com/footwear/mens-work-boots/motorcycle-boots.html?dir=asc&amp;order=sales_index
  </code></pre>
  
  <p>The code I have put in my .htaccess file is as follows:</p>
  
  <pre><code>RewriteRule ^dir/(.*?)/order/(.*?)/(.*?)$ $3.html?dir=$1&amp;order=$2
  </code></pre>
  
  <p>For some reason, when I have this in there, I get a 404 error. Can someone point me in the right direction to make this work for me?</p>