Answer the question
In order to leave comments, you need to log in
How to resolve url?
There is a page on wp, for example, with the slug test, how can you make sure that when you navigate to /test/test2/.../any wp returns the test page template, and not a 404 error?
Answer the question
In order to leave comments, you need to log in
add_action('init', 'do_rewrite');
function do_rewrite(){
add_rewrite_rule( '^test/(.*)/?', 'index.php?page_id=5&sell_query_string=$matches[1]', 'top' );
add_rewrite_tag( '%sell_query_string%', '([^&]+)' );
}
Look at the template_include / template_redirect hooks and what happens on them. Well, yes, with the help of add_rewrite_rule or even add_rewrite_endpoint you can create additional rules that will be processed correctly.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question