switch mod rewritten URL <p>We are using a mod rewritten URL within our PHP site, this is the rewrite rule we are using:</p> <pre><code>RewriteRule ^category/([^.]+)/([0-9]+)/([^.]+)/([0-9]+) categories.php?c_id=$2&amp;filters=$3&amp;_p=$4&amp;area=category&amp;areaname=$1 </code></pre> <p>However, a user of a different system is switching to our setup and wants to 301 all their old pages to their new equivalents. So, for example, this URL:</p> <pre><code>http://domain.com/categories/clothing/5/1 </code></pre> <p>becomes:</p> <pre><code>http://domain.com/category/clothing/5/0-0-0-0/1 </code></pre> <p>Is it possible to do this in a single rewrite rule or rewrite match (or similar), my intial thought was something like this would work:</p> <pre><code>RewriteRule /categories/(.*)/(.*)/1 /category/$1/$2/0-0-0-0-0-0-0-0/1 [R=301,L] </code></pre> <p>it doesn't, any ideas?</p> <p>Also tried this with RedirectMatch which also doesnt work:</p> <pre><code>RedirectMatch /categories/(.*)/(.*)/1 http://domain.com/category/$1/$2/0-0-0-0-0-0-0-0/1 </code></pre>