I'm trying to redirect URL www.domain.com/some/my-page--woohoo.html to www.domain.com/index.php?pagename=my-page
I have this rule that is attached to init via add_action('init', 'create_rewrite_rule', 1, 0);
add_rewrite_rule('^.*\/(.*)--woohoo\.html$', 'index.php?pagename=$matches[1]', 'top');
Calling www.domain.com/some/my-page--woohoo.html returns 404, but when is rule changed to
add_rewrite_rule('^.*\/(.*)--woohoo\.html$', 'index.php?pagename=my-page', 'top');
everything works.
It seems that $matches[1] returns nothing :-( Why?
Thank you for any help!