Help with .htaccess

Discussion in 'PHP' started by dannywwww, Jan 24, 2008.

  1. #1
    Hi, i am a little new to php and wondering how could i rewrite this url mysite.com/profiles.php?xid=1 to mysite.com/mynameofmyprofile i think this is possible with .htaccess with rewirte rule but how would i actualy do it ? thanks . ~Danny
     
    dannywwww, Jan 24, 2008 IP
  2. xxKillswitch

    xxKillswitch Peon

    Messages:
    331
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
  3. Kaizoku

    Kaizoku Well-Known Member

    Messages:
    1,261
    Likes Received:
    20
    Best Answers:
    1
    Trophy Points:
    105
    #3
    I don't see how mysite.com/profiles.php?xid=1 could turn to mysite.com/mynameofmyprofile
    turn it to mysite.com/1/mynameofmyprofile would be easier.
    
    RewriteEngine On
    RewriteRule ^([0-9]+)/.+$ /profiles\.php?xid=$1 [L]
    
    Code (markup):
     
    Kaizoku, Jan 25, 2008 IP