mod rewrite screws up with characters, doesn't send to PHP file

Discussion in 'PHP' started by frankcow, Aug 12, 2007.

  1. #1
    Anyone familiar with .htaccess and mod rewrite? I'm trying to configure it on a database driven PHP site, and it screws up on any page that has a special character in the title

    Any help appreciated. Oh, and if it requires real work on your part, I'll pay for your time.
     
    frankcow, Aug 12, 2007 IP
  2. l0gic

    l0gic Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you already have the .htaccess file, post it so we have a better idea of what you're trying to accomplish.

    Usually it's as simple as tweaking the regex to better match the page requests.
     
    l0gic, Aug 12, 2007 IP
  3. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #3
    
    $title = preg_replace(array('/[^\w-\.]/', '/-{2,}/'), '-', $title);
    
    PHP:
    EDIT:

    Or maybe even:
    
    $title = strtr(html_entity_decode(strtolower($title)), 'áàäéèíìóòöúùüñâê', 'aaaeeiiooouuunae');
    
    PHP:
     
    nico_swd, Aug 12, 2007 IP