RewriteEngine on
RewriteRule $ http://domain.com/index.php?section=news
RewriteRule ([a-zA-Z]+)([/]?)$ http://domain.com/index.php?section=$1
RewriteRule ([a-zA-Z]+)/([a-zA-Z0-9]+)([/]?)$ http://domain.com/index.php?section=$1&action=$2
RewriteRule ([a-zA-Z]+)/([a-zA-Z0-9]+)/([0-9]+)([/]?)$ http://domain.com/index.php?section=$1&action=$2&limit=$3
RewriteRule ([a-zA-Z]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([0-9]+)([/]?)$ http://domain.com/index.php?section=$1&action=$2&id1=$3&limit=$4
RewriteRule ([a-zA-Z]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([0-9]+)/([0-9]+)([/]?)$ http://domain.com/index.php?section=$1&action=$2&id1=$3&id2=$4&limit=$5
hey there guys...
its probably pretty easy to see what i'm trying to do here...
i have the first folders such domain.com/folder1/folder2 being translated into
index.php?section=folder1&action=folder2... it works fine... but in some cases there is going to be other variables /folder1/folder2/33 or /folder1/folder2/33/44/55 with limit being set at 33 and then 55 respectively...
however, the way i did it above seems a bit inefficient and probably to rigidly defined... is there a better to do this... in this case:
domain.com/news/show/11/22/33/44/55/66
could be translated into index.php?section=news;action=show;id1=11;id2=22;id3=33;id4=44;id5=55;limit=66
first and second parts put into section and action respectively the last number the limit and all others inbetween are id1...id5? is it possible to dynamically do this, or does there have to be strict rules for everything in the .htaccess file?
cheers
stewart