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
mod rewrite question
Moderator: General Moderators
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Code: Select all
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [S=1]
RewriteRule ^(.+)/?$ /users/$1 [QSA,L]