Page 1 of 1

mod rewrite question

Posted: Sat Jul 22, 2006 5:18 pm
by thiscatis
Ok, I have mod_rewrite enabled on my server.

I tried to look for some examples but couldn't found somethink like I want.

If someone goes to the URL

http://www.mydomain.com/username/

I want the server to be actually loading
http://www.mydomain.com/users/username/

1. Is this possible with mod_rewrite?
2. What do I have to add to my htaccess file?

Te thing is, I can make something like that if the username is static.
But I need it to be dependent on what the visitors type as URL

Posted: Wed Jul 26, 2006 2:17 am
by RobertGonzalez

Code: Select all

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [S=1]
RewriteRule ^(.+)/?$ /users/$1 [QSA,L]