views:

46

answers:

1

How can I get Apache rewrite to do the following...

take a url received as:

domain/somename/index.php?query=1&anotherquery=2

and change it to:

domain/index.php?query=1&anotherquery=2&name=somename

cheers, Omer.

+1  A: 

Try this rule in your .htaccess file:

RewriteRule ^([^/]+)/index\.php$ index.php?name=$1 [QSA]
Gumbo
thanks, saved my day
Omer