• andytela

    (@andymoonshine)


    HI

    I have a bizarre error with the rewrite rules basically my rule should say this

    [cases/sectors/([^/]*)/?$] => index.php?post_type=cases&sectors=$matches[1]
    But instead it comes out like this

    [cases/sectors/([^/]*)/?$] => index.php?post_type=cases§ors=$matches[1]

    Basically &sect in the url is changing to the entity §

    Anyone come across this & how would I stop this from occurring?

    Cheers
    Andy

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter andytela

    (@andymoonshine)

    Fixed it using htmlspecialchars

    Cheers
    Andy

    Thread Starter andytela

    (@andymoonshine)

    Actually the above fix didn’t work
    Even though outputting the results of the rules it looked correct somewhere along the line it must convert it again

    I got around it by changing the order of my query to
    [cases/sectors/([^/]*)/?$] => index.php?sectors=$matches[1]&post_type=cases
    So the ampersand didn’t appear next to the word sect and create an entity

    Obviously this worked for my case but there must be other times when it’s not possible to not have an ampersand next to a word that will create an html entity

    Cheers
    Andy

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Rewrite rules & entities’ is closed to new replies.