79570608

Date: 2025-04-12 15:18:44
Score: 2
Natty:
Report link

So, no help ? :(

If anyone is interested, I didn't manage to get my dynamic rule working without impacting the edition of Wordpress pages, so I just used a rule with a static array of makes instead :

$all_makes_rules = array(
        'AC', 'Acura', 'Adler', 'Alfa Romeo', 'Alpina', 'Alpine', 'AMC', 'Apal', 'Aro', 'Asia', 'Aston Martin', [...]
, 'ZX'
);
// The real code contains all the makes. Just making it shorter here.

$all_makes_rules = array_map(function($make) {
     return str_replace(' ', '_', strtolower($make));
}, $all_makes_rules);

$pattern = implode('|', $all_makes_rules);

[...]
"^(?i:fr/($pattern)/?$)" => 'index.php?pagename=car-make-fr&make=$matches[1]',
"^(?i:en/($pattern)/?$)" => 'index.php?pagename=car-make&make=$matches[1]'[...]

This works fine.

But if anyone has any idea on how to get my original dynamic rule working, I'm still interested ...

Reasons:
  • Blacklisted phrase (1): :(
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Franck FELIX