1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Mod rewrite problem

Discussion in 'Apache' started by Dejavu, Jul 10, 2005.

  1. #1
    I use the following rewrite to rewrite URLs like
    domain/example/
    to
    domain/index.php?a=example

    RewriteRule ^(.*)/$ /index.php/?a=$1
    Code (markup):
    works fine, except when there is an '&' in the url (eg "domain/bla%26more") (the & is correctly encoded to %26)
    in this case the variable a will only be bla, instead of blamore

    any ideas?
     
    Dejavu, Jul 10, 2005 IP
  2. nddb

    nddb Peon

    Messages:
    803
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #2
    is the &more a separate variable? Or are you just saying there could be an & in the word, like "example" and "dog&cat"?

    It's really strange that it would break at all on the &.
     
    nddb, Jul 10, 2005 IP
  3. Dejavu

    Dejavu Peon

    Messages:
    916
    Likes Received:
    53
    Best Answers:
    0
    Trophy Points:
    0
    #3
    actually there is no & at all in the url, just the encoded form of & (%26)
    eg /dog gets rewritten to /?a=dog
    /dog%26cat should get /?a=dog%26cat, but for some reason the variable a in php is then only dog.

    if i manually type in /?a=dog%26cat the variable a is correctly 'dog&cat'
     
    Dejavu, Jul 11, 2005 IP
  4. nddb

    nddb Peon

    Messages:
    803
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I've searched for info on this, and I don't see much on it, and I haven't run into this problem myself, so I'm not quite sure. I'll keep looking, and this post will bump it, so perhaps someone else knows.
     
    nddb, Jul 15, 2005 IP