*  *** Also note that parameters will be in the context of the main front controller constructor. ***
  */
 
+// Setup rewrite for member detail pages
+add_filter('rewrite_rules_array', function($rules) {
+
+    // Check if rule is not set
+    if ( ! isset( $rules['('.$this->config['settings']['canonical_package_page'].')/([^/]*)$'] ) ) {
+
+        // Add the new rule
+        $newrules = array();
+        $newrules['('.$this->config['settings']['canonical_package_page'].')/([^/]*)$']='index.php?pagename=$matches[1]&packageslug=$matches[2]';
+        return $newrules + $rules;
+    }
+
+    // If already set, just return the rules unchanged.
+    return $rules;
+
+});
+
+/* This code is being replace for testing by the above to avoid intermittent 404's on the detail pages.
 // Check if the canonical package page rewrite rule is not currently in place.
 $rules = get_option( 'rewrite_rules' );
 if ( ! isset( $rules['('.$this->config['settings']['canonical_package_page'].')/([^/]*)$'] ) ) {
     });
 
 }
+*/
 
 /*
  * Package Detail Page Canonical URL Fix