rabu Posted February 25, 2007 Share Posted February 25, 2007 Hi, I'm fairly new to PHP, and have a question I hope one of you guys can help me with. I was wondering how to make it possible for the users of a site (that I'm currently working on) to have a unique URL, as their username - e.g.: www.site.com/username1, www.site.com/username2 and so on... I really hope some one, can help me with a point of direction or some resource or tutorial links. Kind regards, - Ras Link to comment https://forums.phpfreaks.com/topic/40062-unique-username-url/ Share on other sites More sharing options...
ted_chou12 Posted February 25, 2007 Share Posted February 25, 2007 I believe you should have a search in google, ".htaccess" + redirection , you will get something or tutorial. If you still cant find anything, I will try to explain it to you. Ted Link to comment https://forums.phpfreaks.com/topic/40062-unique-username-url/#findComment-193761 Share on other sites More sharing options...
rabu Posted February 25, 2007 Author Share Posted February 25, 2007 Okay thanks, I have been looking at it. So you mean that something like this: RewriteRule ^([A-Za-z0-9-]+)/?$ username.php?username=$1 [L] would do the trick. I case a user types in this URL: www.site.com/username1, then my PHP-file (username.php) will get the parameter username=username1 (www.site.com/username.php?username=username1)? But wont that be visible in the browser URL to the end-user (www.site.com/username.php?username=username1)? Or does the browser URL still stick with www.site.com/username1 - when I'm using the "RewriteRule"? Thanks for your help so far, but would like to get the question above clarified if you know about that. Thanks, - Ras Link to comment https://forums.phpfreaks.com/topic/40062-unique-username-url/#findComment-193793 Share on other sites More sharing options...
Jessica Posted February 25, 2007 Share Posted February 25, 2007 If you use the [NC] tag instead of [L] they will not see the change. Link to comment https://forums.phpfreaks.com/topic/40062-unique-username-url/#findComment-193800 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.