need help with url re-writing

Discussion in 'Apache' started by sunnyverma1984, Sep 17, 2010.

  1. #1
    i want to re-write url in following manner
    
    http://www.domain.com/profile.php?user=username
    
    http://www.domain.com/username
    Code (markup):

     
    sunnyverma1984, Sep 17, 2010 IP
  2. sunnyverma1984

    sunnyverma1984 Well-Known Member

    Messages:
    342
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    120
    #2
    no replies :(
     
    sunnyverma1984, Sep 22, 2010 IP
  3. jocurileus

    jocurileus Peon

    Messages:
    53
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    RewriteRule ^([A-Za-z0-9]+)(/)?$ profile.php?t=$1 [L]
    Code (markup):
    Unfortunately, this will redirect all your www(dot)domain(dot)com/article.
    This means you have to use www(dot)domain(dot)com/onewordusernames type like urls only for users.

    My recommendation is to use something like this www(dot)domain(dot)com/user/username

    RewriteRule ^user/([A-Za-z0-9]+)(/)?$ profile.php?t=$1 [L]
    Code (markup):
     
    jocurileus, Sep 22, 2010 IP