I’ve a hyperlink like this: https://instance.com/page-test/?v=p300 and I created rewrite rule to level new url: https://instance.com/page-test/p300/ nevertheless it doesnt work.
Simply there’s redirect to right web site however second parametr “v” is empty.
My code:
add_action('init', 'add_test_url');
perform add_test_url() {
add_rewrite_rule('^page-test/([^/]+)/?$', 'index.php?pagename=page-test&v=p300', 'prime');
}
So first argument pagename is OK and web site is redirected to the right web page however second parametr is empty … why ? Or course after the change I save the settings permalinks.