htaccess rule to allow spaces in the url...

Discussion in 'Apache' started by mrconstantine, Jul 5, 2006.

  1. #1
    Hi,

    I've been trying for hours to get this to work, its simple.. All i want to do is have a rewrite rule that allows http://www.domain.com/make/Aston Martin and passes the make to http://www.domain.com/viewmake?make=Aston Martin

    Right now if I go to www.domain.com/make/Aston%Martin, and try to echo the make, all it will echo is 'Aston', it loses everything after the space...

    Heres the rule that works fine for makes with no spaces in them...

    RewriteRule make/([-a-zA-Z0-9]+) viewmake.php?make=$1 [L]

    Simply, how do I allow spaces in the rule? (%20)

    Cheers
    Mrconstantine
     
    mrconstantine, Jul 5, 2006 IP
  2. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #2
    RewriteRule ^make/([^.]+)$ viewmake?make=$1 [L]
     
    Nintendo, Jul 5, 2006 IP