Are you trying to pass a parameter to a wordpress page. And don’t want to pass it as a query string. You would like to pass as a slash based url?
Example:
http://localhost/mysite/pagename?user=myname
into
http://localhost/mysite/pagename/myname
Here is the solution:
add_action('init', function(){
add_rewrite_rule(
'^yourPageSlug/([^/]+)([/]?)(.*)',
//!IMPORTANT! THIS MUST BE IN SINGLE QUOTES!:
'index.php?pagename=yourPageSlug&user=$matches[1]',
'top'
);
});