I just noticed on mySpace.com each user get their own kind of virtual directory. For example if you type www.myspace.com/nodoubt it goes to one profile or if you typw www.myspace.com/blackout it goes to another.

How do they do this? I want so www.mydomain.com/name1 would point to
www.mydomain.com/profile.php?id=1

or www.mydomain.com/name2 would point to
www.mydomain.com/profile.php?id=2

How can I do that?

also if you go to www.clubzone.com you'll notice that each member or gallery has their own .html file. Does this mean they create an html file for all their 300,000 users and 100,000 galleries?

Thanks a lot

    MySpace is written in Cold Fusion which means they either have a really good IIS Cluster or someone who is very knowlegeable about Linux. Chances are they is just one page that strips the url down to the "directory name" and queries the db with that name and posts the results via a dynamic template. That's real easy to do with CF, but most people despise CF due to it's high end requirements or ease/speed of coding.

      I know I for one would really really like to know how that works. I have been trying to do something like that for awhile. I would even enjoy making all my external links relative. If ya know what I mean. I think I know how I could do it. I have seen sites have a hundred links leading out of the site but they were all relevent paths and had the same naming convention we are talking about here.

        Create a .htaccess file and place in it your HTML root directory.

        RewriteEngine  on
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^([^/]+)/$ /profile.php?user=$1 [L]
        

        The first line starts the Rewrite Engine.

        The 2nd line checks to see if that first paramater is not an actual directory such as /images.

        The 3rd line get's the name <http://www.mysite.com/peterpan> and points it to <http://www.mysite.com/profile.php?user=peterpan>. Your PHP script would then search the database for a user with that name and show the profile.

        Hope it helps.

        best,
        Cent

          Write a Reply...