I’ve found a number of solutions on stackoverflow on rewriting urls with a variable number of variables. But wasn’t able to find anything on the situation where these variables can occur in a variable order. In my case I’ve a page with 4 potential variables:
www.domain.com/page.php?a=var1&b=var2&c=var3&d=var4
I want my users to be able to access this as:
www.domain.com/page/var1/var2/var3/var4
So far I was able to do this with htaccess. But the problem is that not all the variables occur anytime. I want Url’s like these be possible:
www.domain.com/page/var1/var2/var4
www.domain.com/page/var1/var4
www.domain.com/page/var1/var3
etc.
I think this is not possible with htaccess. But what would be the most elegant solution to use clean Url’s on this one.
Hope anyone has any ideas…
A very fine, clean URL already is:
If you don’t think so (I like these URLs, they are very semantic), and if you now need to preserve information about which parameter is what, you just need to keep the names:
works perfectly with .htaccess.