0

I want to rewrite the dynamic URL https://example.page/detail-view/?mediaId=2316 and get the SEO-frendly URL https://example.page/detail-view/2316 instead. How can I achieve that?

Thank you in advance.

2
  • 1
    What are detail-view and mediaid? Please add this information to the question.
    – Max Yudin
    Commented Jan 9, 2022 at 15:17
  • detail-view is the name of the page and mediaId is a parameter with the post-ID Commented Jan 10, 2022 at 11:45

1 Answer 1

0

You might use following in that case

  • It's okay to keep http://example.com/key_name/key_value simply by passing in your template using function add_query_arg( 'key', 'value', 'http://example.com' );
  • get_query_var('key_name') to fetch the Value of Query parameters in your template file instead of using $_GET['key_name'] .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.