Forum Moderators: phranque

Message Too Old, No Replies

redirect directory to a php script

         

vovovo

5:52 am on Sep 8, 2008 (gmt 0)



Each user on my site can have it's own area: www.mysite.com/foobar where foobar is username. I want each of this to be processed by a php file: www.mysite.com/script.php?id=foobar.
Currently I use this

RewriteEngine On
RewriteRule ^([A-Za-z0-9]+)$ sub.php?id=$1 [L]

But the script.php script uses query strings like sub.php?id=foobar&offset=20&searchterm=test

If someone could tell me how to do this i'd be grateful.

g1smd

10:00 am on Sep 8, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Grab the parameters by testing %{QUERY_STRING}

Without you posting a lot more detail in the question, coming up with code is impossible.

Post your best effort code here as a basis for discussion...

jdMorgan

3:16 pm on Sep 8, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



See the [QSA] flag for RewriteRule.

Jim