Results 1 to 3 of 3

Thread: [PHP] Pretty URLs - $_GET After URL?

  1. #1
    Join Date
    Aug 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default [PHP] Pretty URLs - $_GET After URL?

    Note: This is not a request on how to do pretty URLs.

    Okay, so I've gotten these pesky things down (.htaccess) and now I've run into a problem.

    I want to be able to have $_GET variables still available to use after the Pretty URL.

    Example:
    http://example.com/user/John?var=5

    I've seen it done in many places, such as Facebook, but have yet to learn how to actually do it.

  2. #2
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    Would need to see how you're doing it atm, but with htaccess you can use the [QSA] flag to keep the query string intact.

    Please post what you have if this doesn't help and I'll see if there's anything else I can think of.

  3. #3
    Join Date
    Aug 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Well, it's not a big .htaccess file or anything.

    Code:
    RewriteEngine on
    RewriteBase /Project/Experiments
    
    RewriteRule ^user/([A-Za-z0-9\_\-\/]+)$ users/page.php?u=$1
    So the following link would work:
    http://example.com/Project/Experiments/user/Phrate

    But I want to be able to do:
    http://example.com/Project/Experiments/user/Phrate?var=something

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •