Dynamic to static URL

Discussion in 'PHP' started by dolin88, Oct 2, 2008.

  1. #1
    How does website like friendster turn their dynamic profile into static url? Do they use htaccess or is there any special method in php?
     
    dolin88, Oct 2, 2008 IP
  2. garrettheel

    garrettheel Peon

    Messages:
    341
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    garrettheel, Oct 2, 2008 IP
  3. Kaizoku

    Kaizoku Well-Known Member

    Messages:
    1,261
    Likes Received:
    20
    Best Answers:
    1
    Trophy Points:
    105
    #3
    google mod_rewrite
     
    Kaizoku, Oct 2, 2008 IP
  4. Grit.

    Grit. Well-Known Member

    Messages:
    1,424
    Likes Received:
    22
    Best Answers:
    1
    Trophy Points:
    110
    #4
    Grit., Oct 2, 2008 IP
  5. ads2help

    ads2help Peon

    Messages:
    2,142
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    0
    #5
    That is mod_rewrite and can be done using .htaccess
     
    ads2help, Oct 2, 2008 IP
  6. dolin88

    dolin88 Banned

    Messages:
    322
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    yes. what if we had 10 000 members? How do we rewrite the profile page into unique username? Add 10 000 rewrite line?
     
    dolin88, Oct 2, 2008 IP
  7. Kaizoku

    Kaizoku Well-Known Member

    Messages:
    1,261
    Likes Received:
    20
    Best Answers:
    1
    Trophy Points:
    105
    #7
    No, only need 1 line. Can you just google and read the mod_rewrite article ok?
     
    Kaizoku, Oct 2, 2008 IP
  8. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #8
    I wouldn't use htaccess in particular if you have too many visitors, it'll cause you heavier apache loads.

    I would suggest you use PHP like Grit recommended.

    Peace,
     
    Barti1987, Oct 2, 2008 IP
  9. cgo85

    cgo85 Peon

    Messages:
    380
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #9
    you could easily use htaccess for this...

    changing something like:abcd.com/user.php?username=USERNAME to abcd.com/USERNAME

    I'm not 100% sure, but this should work:

    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*)/$ /user.php?$1=$2
     
    cgo85, Oct 3, 2008 IP