I have a page that I access at /category/tasks and the file is located at wp-content/themes/my-theme/tasks.php. I would like to make it so I can add a flag after tasks and pick up the query strong in tasks.php. This works fine when I access the page with /category/tasks/?when=upcoming.
Can someone tell me how to use rewrite_rules_array so it will send the variable through the query string using the URL structure /category/tasks/upcoming?