I have a link like this: https://example.com/page-test/?v=p300 and I created rewrite rule to point new url: https://example.com/page-test/p300/ but it doesnt work.
Just there is redirect to correct website but second parametr "v" is empty. My code:
add_action('init', 'add_test_url');
function add_test_url() {
add_rewrite_rule('^page-test/([^/]+)/?$', 'index.php?pagename=page-test&v=p300', 'top');
}
So first argument pagename is OK and website is redirected to the correct page but second parametr is empty ... why ? Or course after the change I save the settings permalinks.