Modernvox Posted January 31, 2010 Share Posted January 31, 2010 Hi Guyz, Is it possible to add user profiles to a sites url as facebook and myspace and similar sites do using php? If so, is there any good tutorials out there for this. I googled , but hundreds of facebook stories come up. Thanks in Advance Quote Link to comment https://forums.phpfreaks.com/topic/190424-vanity-url-for-user-profiles/ Share on other sites More sharing options...
Modernvox Posted January 31, 2010 Author Share Posted January 31, 2010 How would i go about creating a profile page for each user? Quote Link to comment https://forums.phpfreaks.com/topic/190424-vanity-url-for-user-profiles/#findComment-1004515 Share on other sites More sharing options...
premiso Posted January 31, 2010 Share Posted January 31, 2010 Perhaps this will help you get your head around the idea of how to do it: http://www.phpfreaks.com/forums/index.php/topic,286115.msg1356963.html#msg1356963 Quote Link to comment https://forums.phpfreaks.com/topic/190424-vanity-url-for-user-profiles/#findComment-1004516 Share on other sites More sharing options...
Modernvox Posted January 31, 2010 Author Share Posted January 31, 2010 Perhaps this will help you get your head around the idea of how to do it: http://www.phpfreaks.com/forums/index.php/topic,286115.msg1356963.html#msg1356963 Thanks Presimo looks promising Quote Link to comment https://forums.phpfreaks.com/topic/190424-vanity-url-for-user-profiles/#findComment-1004517 Share on other sites More sharing options...
laffin Posted January 31, 2010 Share Posted January 31, 2010 That does show a profile page, but the url would look like http://my.domain.com/view.php?id=1 but I dont see it as a vanity url as the topic title suggests. I think a vanity url would look like this: http://my.domain.com/profile/Username which u can accomplish with a script like premiso shows to display a profile page, but instead of the id, u will be using the username. with that accomplished, you will need Apache ModRewrite in order to take the vanity url and process it into a script url if you modify the view php to handle username lookups instead of id lookups http://my.domain.com/view.php?username=Test1 you can use mod-rewrite to use a url like above with .htaccess like RewriteEngine on RewriteRule ^profile/([^/\.]+)$ view.php?username=$1 [L] Quote Link to comment https://forums.phpfreaks.com/topic/190424-vanity-url-for-user-profiles/#findComment-1004525 Share on other sites More sharing options...
Modernvox Posted January 31, 2010 Author Share Posted January 31, 2010 That does show a profile page, but the url would look like http://my.domain.com/view.php?id=1 but I dont see it as a vanity url as the topic title suggests. I think a vanity url would look like this: http://my.domain.com/profile/Username which u can accomplish with a script like premiso shows to display a profile page, but instead of the id, u will be using the username. with that accomplished, you will need Apache ModRewrite in order to take the vanity url and process it into a script url if you modify the view php to handle username lookups instead of id lookups http://my.domain.com/view.php?username=Test1 you can use mod-rewrite to use a url like above with .htaccess like RewriteEngine on RewriteRule ^profile/([^/\.]+)$ view.php?username=$1 [L] Ok will read up on this and repost when I get somewhere, Thanks guyz! Quote Link to comment https://forums.phpfreaks.com/topic/190424-vanity-url-for-user-profiles/#findComment-1004761 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.