using mod_rewrite
Posted by: vgjunkie
Posted on: 2006-03-17 12:21:00
I've been at this for a few hours now, and I can't seem to find anything that works. I've tried combinations of things and nothing seems to work out.
What I am trying to do is when a user visits:
http://domain.com/user
it will rewrite to:
http://domain.com/?u=user (or even /index.php?u=xyz)
"user" will be dynamic, so it can be user, person, 3xyzn ..etc
Now, I don't want it to rewrite if the file/directory actually exists. Any ideas on how to make this work?
I've tried this:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !-f
RewriteCond %{REQUEST_URI} ^/(.*)$
RewriteRule ^/(.*)$ /index.php?u=$1 [R,L]
It keeps giving me a 404. Any ideas?