I know I can turn: http://www.mywebsite.com/?user=username into: http://www.mywebsite.com/user/username But can I turn it into: http://www.mywebsite.com/username ..?
It really depends... would this be used, like to show profiles here on DP ? if so maybe something like this should work, but bare in-mind, this might cause problems to other rules, but not file names. Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule (.[^/]*) /member.php?user=$1 [NC,L] Code (markup):
All I am trying to do is give the user a shorter URL. So, if the user goes to: http://www.mywebsite.com/username It will act as: http://www.mywebsite.com/?user=username ... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f Code (markup): What does the above do?
Its to tell the server that the username is not a file or directory name, anyway whats the current url your users goto ?
The url is: http://www.mywebsite.com/?user=username I could just make a rewrite, so that if I enter: http://www.mywebsite.com/user/username ..in the browser, it will load just the same. There's URL rewrite generators all over the Internet for that. However, I don't want: http://www.mywebsite.com/user/username I want: http://www.mywebsite.com/username The current URL is: http://www.mywebsite.com/?user=username
and if you try this what happens ? Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule (.[^/]*) /index.php?user=$1 [NC,L] Code (markup): http://www.mywebsite.com/username
Try this: RewriteEngine On RewriteRule ^([^/]*)/$ /?user=$1 [L] Code (markup): This will return: http://www.mywebsite.com/username/