I'm trying to create a rewrite rule that would let me catch usernames like
mydomain.com/{username}
By using a rule sort of like:
'([a-zA-Z0-9\._-]+)/?$' => 'index.php?pagename=profile&username=$matches[1]'
However, this would impact all page queries. For example, I still want mydomain.com/about to return the About page, not a username.
Is there anyway I can use the Rewrite API to insert this rule only if the match is an existing username?