Forum Moderators: phranque

Message Too Old, No Replies

Myspace style profile urls?

How can this be implemented in apache?

         

jrlstanford

5:17 am on May 19, 2007 (gmt 0)

10+ Year Member



Hello,

For my project I'd like to implement a Myspace style user profile URL. If you're not familiar with this, what myspace does is allow users to specify a direct URL where friends can access their profiles (i.e. www.myspace.com/your_profile). your_profile can be modified to anything the user wants, and will always point to his profile (assuming no one else already has that URL). I know I could probably do it the simple way - by creating a directory called your_profile and then copying the user's profile into a file called index.php into that directory. But that seems like a very stupid and inefficient way to solve the problem. I know there must be a better way to do it - can I write some kind of handler that will first check if a request matches the URL of a user's profile, and if so, directs the request to that profile page? Or is this some kind of Perl script? Any help is much appreciated.

Thanks.

jdMorgan

3:01 pm on May 20, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can do it many ways, with mod_userdir, mod_alias, mod_rewrite, a PERL or PHP script and mod_rewrite or AcceptPathInfo (Apache 2.0 and later), *nix symbolic links, and many combinations of these. I'd recommend you go with whatever approach best fits with the technology you're familiar with.

Jim