architact 25 Junior Poster

Hello, I just finished creating an online site builder and now its time to launch it, I am facing a problem related to URL-Rewriting.

My site builder contains all the files and folders which will make up the client's site inside a folder named as "usersite", and can be access theough http://www.mydomain.com/usersite, what I want is that instead of "usersite", I want to display the user's choosen username in the address, I have tried many way but nothing is working, Right now what I have is that I have to create a rewrite rule for each registered user manually.
E.g

Options +FollowSymlinks
RewriteEngine On 
RewriteRule ^user1/(.*)$ usersite/$1&teamname=$0 [nc]
RewriteRule ^user2/(.*)$ usersite/$1&teamname=$0 [nc]
RewriteRule ^user3/(.*)$ usersite/$1?teamname=$0 [nc]
RewriteRule ^user4/(.*)$ usersite/$1?teamname=$0 [nc]

This code is not working completely as if I access a page with query string in the address I can't access the query string variables.

Please help me with this problem.

Thanks in Advance.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.