[wp-hackers] Unicode url rewriting using add_rewrite_rule()

Deepak Mittal dpac.mittal2 at gmail.com
Wed Dec 12 17:36:33 UTC 2012


Hey,

I'm trying to redirect urls based on regex compatible with unicode
characters. It looks something like this:

add_rewrite_rule(
            '^analytics/([\p{L}\p{N}\_]*)/?$',
    'index.php?analytics=$matches[1]',
    'top'
);


However, this still doesn't work with unicode characters as I need to pass
a regular expression modifier 'u' with it. Any idea how I can do that?

-- 
Regards,
Deepak Mittal,
Twitter - @dpacmittal


More information about the wp-hackers mailing list