1

I am currently working on wordpress. URL 0f site is something like this

example.com/dashboard-form/?din=random12.

I want the url to be like this

example.com/dashboard-form/random.

Thanks in advance

Niranjan N Raju
  • 12,047
  • 4
  • 22
  • 41

1 Answers1

1

To be added on init:

To register your custom variable ('din' in the question)

add_rewrite_tag('%mycustomvar%','([^&]+)');

To create a re-write rule:

add_rewrite_rule('^product/([0-9]{1,})/?','index.php?p=4&mycustomvar=$matches[1]','top')

For more please refer below link:

https://wordpress.stackexchange.com/questions/48487/how-to-retrieve-get-variables-from-rewritten-urls

Try to add rewrite rule and let me know if any query.

Community
  • 1
  • 1