i have this gallery which has links like this.

gallery.php?user=205
205 here is a userid.

i am using mod_rewrite to have another script decide the userid from this url.

mysite.com/gallery/someuser

here "someuser" is username. the script in mod_rewrite is deciding the userid from the username. it's in the database.

i am using the header() function in the script to get the the gallery.php?user=$id

now the URL on the browser changes to gallery.php?user=205

for an example username "someuser" has a userid of 205.
so when someone visits http://mysite.com/gallery/someuser, mod_rewrite sends it to redirect.php?username=someuser

then redirect.php finds out the userid from the database and redirects to gallery.php?user=205.

as the redirect.php is using the header() function to redirect, the browser url changes to gallery.php?user=205.

is there a way to get around this and the URL in the browser stays the same?

gallery.php isnt a script of my own and i don't feel like editing it.