Hi there,
I'm trying to rewrite a slightly confusing (for me) url to a php readable url, which is just as confusing,
basically something like this
http://localhost/category/category2/category3
The number of categories that may be present is dynamic (upto 4 I should think)
and I would need to rewrite this into something as
php/browse.php?Cat1=%&Cat2% etc
Don't have a clue how to acheive this tho, any help would be great!
stuck on URL Rewrite
Moderator: General Moderators
You will need to check for the maximum number first, then the next lowest, etc...
Code: Select all
# 4 cats
RewriteRule ^/(.+)/(.+)/(.+)/(.+)$ /script.php?cat1=$1&cat2=$2 .....
# 3 cats
RewriteRule ^/(.+)/(.+)/(.+)$ /script.php?cat1=$1&cat2=$2 ..... [