## WordPress add a rewrite rule to a page to accept a GET variable

Question

I want to rewrite

mysite.com/events/submission/test-event-01

to

mysite.com/events/submission?epl=test-event-01

This is what I have done so far without any result. I get a 404 error (mysite.com/events/submission/test-event-01). Can anyone suggest the correct rule?

function epl_rewrite()
{
add_rewrite_rule('^submission/([^/]*)[/]?', 'index.php?pagename=submission&epl=$matches[1]', 'top'); } function epl_query_vars($query_vars )
{
$query_vars[] = 'epl'; return$query_vars;
}

Note:

1. Permalinks are re-saved to flush the rewrite rules.