PHP redirect

Discussion in 'PHP' started by jay53, Jul 9, 2007.

  1. #1
    My question
    Is it possible to make a php page/script that can redirect a url and maintain the basic structure.
    What I'd like to do is redirect this url ( http://www.site.com/place/?L=users.profile&username=Kylie ) to

    ( http://www.site.com/place/?L=users.profile&id=Kylie ) Just changing input username to id so it can quarry id in the main script.


    Thank You
    Jay
     
    jay53, Jul 9, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    
    RedirectMatch 301 ^place/\?L=users\.profile&username=(.+) place/?L=users.profile&id=$1
    
    Code (markup):
    Save this as .htaccess in your root dir.
     
    nico_swd, Jul 9, 2007 IP