htaccess URL Rewriting question for special chars

Discussion in 'Apache' started by Sw00p, Dec 16, 2009.

  1. #1
    I would like to do an URL rewriting for my search-pages.

    I would like to have my urls like this :

    http://www.mysite.com/search/searchterm/3

    I'm really bad with regular expressions..can somone please help me out..
    I tryed by my self for 4-5h :confused:

    my try:
    RewriteRule ^search/(.*)/([0-9]+)$ index.php?a=search&term=$1&page=$2

    k this one works but it's not 100% cuz I noticed if someone enters "#?\" this pattern would not match :(

    please I need help :confused:
     
    Sw00p, Dec 16, 2009 IP
  2. szalinski

    szalinski Peon

    Messages:
    341
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    why not use

    RewriteRule ^search/([^/]+)/(.*)$ index.php?a=search&term=$1&page=$2
    PHP:
    ?
     
    szalinski, Dec 22, 2009 IP