WPNetwork with custom URL Rewrite rules

First, I didn’t flush the rewrite rules so, or course, the rule wasn’t being included.

Second, I ended up going with a MUCH simpler solution to passing the variable to any page with the template applied, which was add_rewrite_endpoint.

add_action('init', 'my_add_endpoints');

function my_add_endpoints()
{
    add_rewrite_endpoint('myendpoint', EP_PAGES);

}

!IMPORTANT – add_rewrite_endpoint registers a query var for you and sets that var’s value to whatever directly follows it.

So this url:

http://mysite.com/mypage/myendpoint/myvalue

becomes:

http://mysite.com/index.php?pagename=mypage&myendpoint=myvalue

It took me two days to eventually figure out what should have already been written in the codex. I hope this helps whomever comes across it.