TylerDiaz Posted March 29, 2009 Share Posted March 29, 2009 I have googled it and tried finding how it is done, but not much luck. So i come asking fellow php developers. You know how on twitter and a couple of other sites when you register you get a custom directory according to your registered username? How is that acomplished? Link to comment https://forums.phpfreaks.com/topic/151583-twitter-like-user-directory/ Share on other sites More sharing options...
Daniel0 Posted March 29, 2009 Share Posted March 29, 2009 One solution would be to use mod_rewrite: RewriteRule ^([a-z0-9]+)$ profile.php?username=$1 Check out the documentation for a more elaborate explanation of how it works. It's sort of the same thing we've done here: http://www.phpfreaks.com/profile/Daniel0. We just put /profile in front of the username. It's not really a directory, but the URL is rewritten to another URL that exists. Link to comment https://forums.phpfreaks.com/topic/151583-twitter-like-user-directory/#findComment-796141 Share on other sites More sharing options...
TylerDiaz Posted March 29, 2009 Author Share Posted March 29, 2009 One solution would be to use mod_rewrite: RewriteRule ^([a-z0-9]+)$ profile.php?username=$1 Check out the documentation for a more elaborate explanation of how it works. It's sort of the same thing we've done here: http://www.phpfreaks.com/profile/Daniel0. We just put /profile in front of the username. It's not really a directory, but the URL is rewritten to another URL that exists. Hmm i seem to be understanding the concept. Think you can provide a bit more indepth of an explination? Do i modify the .htaaccess and add the code there or? Link to comment https://forums.phpfreaks.com/topic/151583-twitter-like-user-directory/#findComment-796221 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.