awbarton222 Posted April 5, 2010 Share Posted April 5, 2010 Hi everyone! Im not very good with php yet so I need some help. I have a php based site similar to etsy.com. I want to make the users "shop" end in their username for example www.kaloves.com/username currently I have it set http://www.kaloves.com/seller_shop.php?uid=30 I have read a little bit that I have to edit the .htaccess file. I was hoping someone could explain to me exatlcy what I need to do as if you were speaking to a 5 year old child. I want to make sure it doesn't affect any of the other related links off of the shop page. Thanks for your help! Link to comment https://forums.phpfreaks.com/topic/197648-php-username-domains/ Share on other sites More sharing options...
awbarton222 Posted April 5, 2010 Author Share Posted April 5, 2010 can anyone help me with this? I need to make this fix asap. Thanks so much! Link to comment https://forums.phpfreaks.com/topic/197648-php-username-domains/#findComment-1037472 Share on other sites More sharing options...
langemarkdesign Posted April 5, 2010 Share Posted April 5, 2010 I believe you would have to create a new directory for each user using mkdir(), see http://php.net/manual/en/function.mkdir.php. Inside each users directory you can create a file that redirects to that users page, http://www.kaloves.com/seller_shop.php?uid=30. Hope this helps Link to comment https://forums.phpfreaks.com/topic/197648-php-username-domains/#findComment-1037475 Share on other sites More sharing options...
awbarton222 Posted April 6, 2010 Author Share Posted April 6, 2010 Thanks, I heard some other ideas also...anyone else? Link to comment https://forums.phpfreaks.com/topic/197648-php-username-domains/#findComment-1037578 Share on other sites More sharing options...
trq Posted April 6, 2010 Share Posted April 6, 2010 You don't need a new directory for each user, but within seller_shop.php you would need to change your query to work with a username instead of uid. You would then use mod-rewrite to rewrite your urls from www.kaloves.com/username to www.kaloves.com/seller_shop?uid=username Link to comment https://forums.phpfreaks.com/topic/197648-php-username-domains/#findComment-1037582 Share on other sites More sharing options...
anupamsaha Posted April 6, 2010 Share Posted April 6, 2010 And, this kind of redirection can be done through .htaccess file, if you have the access in the server. Thanks Link to comment https://forums.phpfreaks.com/topic/197648-php-username-domains/#findComment-1037640 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.