mod_rewrite question

Porthos

Newbie
Joined
Jun 23, 2012
Messages
38
Reaction score
2
Lets say I have a membership site that I want to let users have clean URLS to their profiles.

I would have a script, like `userprofile.php`, which I want the mod rewrite to call to when a visitor accesses mysitedotcom/aUserName, passing through the username as a GET variable for the script like so `userprofile.php?username=aUserName`.

How would I go about making the rewrite for this?
 
I did some reading in other posts and the only thing I came up with was:
Code:
RewriteRule ^(.*)$ ?username=$1
However would this interfere with other pages say I were to make mysitedotcom/forums I wouldnt want it redirecting to userprofiles.php?username=forums
 
Back
Top