Rewrite rule for including the username?

alright so im starting to get the understand the extremely complicated art of rewriting urls.
i want to be able to make a url have the users username in it before the page that they are on when they are logged in. What i mean is this:
http://sameple.com/user/home
how do i make it so that their username goes where user is instead of a plain url like what i would have now when they’re logged in: http://sameple.com/home.php

caleb,

mod_rewrite is all about logic. If you understand the logic of 0 and 1, you’ll pick-up on mod_rewrite quickly (try the tutorial linked in my signature).

Pseudo code:

If a file request does not exist AND
if the file exists without the first directory (member name)
capture the filename and redirect there.

With the sample code in the tutorial and the above pseudo code, you should be able to create the correct code. If not, show me what you’ve attempted and I’ll get you there.

Regards,

DK

okay, i went through the tutorial and i have a question about the pseudo code. what do you mean if a file request does not exist?

caleb,

If the file requested by a visitor does not exist (i.e., a 404 request), use RewriteCond %{REQUEST_FILENAME} !-f. The AND is implied between this RewriteCond and the next RewriteCond or RewriteRule’s regex.

Regards,

DK