I've been searching but I can't quite find what I'm after. I'm trying to find an elegant way to redirect my url path to the query string via htaccess and mod_rewrite.
The problem is that the path does not have a fixed amound of sub dirs and could be huge.
i.e. http://example.com/sub1/sub2/sub3/sub4/sub5/sub6/sub7...
Currently I just have a load of rules in my htaccess to capture these...
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/? /index.php?sub[]=$1&sub[]=$2&sub[]=$3&sub[]=$4&sub[]=$5 [QSA,L]
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)/? /index.php?sub[]=$1&sub[]=$2&sub[]=$3&sub[]=$4 [QSA,L]
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/? /index.php?sub[]=$1&sub[]=$2&sub[]=$3 [QSA,L]
RewriteRule ^([^/]+)/([^/]+)/? /index.php?sub[]=$1&sub[]=$2 [QSA,L]
RewriteRule ^([^/]+)/? /index.php?sub[]=$1 [QSA,L]
... but there may be more, anyone know of a way to autoamtically parse these in to the query string?
exploded that path by/within your script …