Question

How can I translate an URL like: http://localhost/mySite/?link=OFFERS&sublink=ARTICLE&subsublink=DETAIL

to: http://localhost/mySite/OFFERS/ARTICLE/DETAIL

if one parameter is empty it should still work like this: localhost/mySite/?link=OFFERS&sublink=ARTICLE localhost/mySite/OFFERS/ARTICLE

Extra problem: There is an enter page under index.php and the rewrite should work with index2.php. Best would be if it would work under localhost and on live system without changes.

Currently I'm using: RewriteRule ^([^/.]+)$ index2.php?link=$1 [L] But that only works for one parameter and I couldn't improve this code for ages ^^

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top