This can be a complicated the one that I really hope includes a simple answer...

RewriteRule ^category/([^.]+)/([0-9]+)/([^.]+)/([0-9]+) category.php?c_id=$2&filters=$3&_p=$4&name=$1

This rule would get category/kitchen/10/-------/1

using the following get vals:


The main reason filters were saved in ------- was due to the 9 back references limit. Each would be a different filter variable that we utilized using a split on $_GET['filter'].

I'm now altering my Hyperlink to a non mod rewritten one, to ensure that the rewrite rule becomes:

RewriteRule ^category/([^.]+)/([0-9]+)/([^.]+)/([0-9]+) category.php?c_id=$2&filters=$3&_p=$4&name=$1 [R=301,L]

Note to [R=301,L] therefore it turns into a 301 redirect.

This really is all fine but I'm wondering if there a would be a clever method of splitting the ------- to ensure that each is really a get variable. In order to get


Any idea?

Thanks ahead of time!

Use a RewriteCond to complete that:

RewriteCond $3 ^([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)$
RewriteRule ^category/([^.]+)/([0-9]+)/([^.]+)/([0-9]+) category.php?c_id=$2&f1=%1&f2=%2&f3=%3&f4=%4&f5=%5&f6=%6&f7=%7&f8=%8&f9=%9&_p=$4&name=$1 [R=301,L]