- Code: Select all
# Rewrite static URLs with 0 param to dynamic.
rewriteRule ^cat/?$ /shop.php [L]
# Rewrite static URLs with 1 param to dynamic.
rewriteRule ^cat/([^/]+)/?$ /shop.php?var1=$1 [L]
# Rewrite static URLs with 2 params to dynamic.
rewriteRule ^cat/([^/]+)/([^/]+)/?$ /shop.php?var1=$1&var2=$2 [L]
# Rewrite static URLs with 3 params to dynamic.
rewriteRule ^cat([^/]+)/([^/]+)/([^/]+)/?$ /shop.php?var1=$1&var2=$2&var3=$3 [L]
I have this working well so that the following happens.
website.com/cat/a/b/c --> website.com/shop.php?v1=a&v2=b&v3=c
But really I would like to remove the "cat" pseudodirectory, thus.
website.com/a/b/c --> website.com/shop.php?v1=a&v2=b&v3=c
Any ideas. Ive been round the block on this one! going a bit crazy :=}