getting rid of %20 in url?

Discussion in 'Site & Server Administration' started by cgo85, Dec 5, 2004.

  1. #1
    I using php and some pages that are generated have the URL with the %20 (space symbol) in it. Is there something I can do, like maybe a htaccess code or something to get rid of this.

    Here is an example:

    /city.php?realtor=Acton%20California

    I'd like it to look like this:

    /city.php?realtor=Acton-California
     
    cgo85, Dec 5, 2004 IP
  2. Dirkjan

    Dirkjan The Dutch SEO Guy

    Messages:
    528
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    138
    #2
    the space makes it, just give it an underscore and its fixed.

    *edit* urr. I misread your topic, uhm, now that I know you already see its because of the space, and you can make a - or _ instead, I dont really get ur question anymore?
     
    Dirkjan, Dec 6, 2004 IP
  3. vlead

    vlead Peon

    Messages:
    215
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Just replace the space in Action California with any other desired character.
     
    vlead, Dec 6, 2004 IP
  4. cgo85

    cgo85 Peon

    Messages:
    380
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yeah... I figured it out... that was pretty stupid question.
     
    cgo85, Dec 6, 2004 IP
  5. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You need to decode the string (it's URL-encoded). For example, in JavaScript, you would do something like this:

    var decoded_string = decodeURI(my_string);

    decoded_string will not contain any %xx sequences.

    J.D.
     
    J.D., Dec 6, 2004 IP