you can use a rewrite for this...link to your controller file in the last function and call the view from there.
dont forget to visit the permalinks page and save (this flushes the rewrite rules).
add_action('init', 'anew_rewrite_rule');
function anew_rewrite_rule(){
add_rewrite_rule('^users\\/[a-z]','index.php?is_customusers_page=1','top');
}
add_action('query_vars','controller_set_query_var');
function controller_set_query_var($vars) {
array_push($vars, 'is_customusers_page'); // ref url redirected to in add rewrite rule
return $vars;
}
//we'll call it a template but point to your controller
add_filter('template_include', 'include_controller');
function include_controller($template){
// see above 2 functions..
if(get_query_var('is_customusers_page')){
//path to your template file
$new_template = get_stylesheet_directory().'/controllerpath.php';
if(file_exists($new_template)){
$template = $new_template;
}
}
return $template;
}
GETthen you could add the variable after/users/to make/users/?user=and then add on your variable, butGETisn't ideal for handling stuff like usernames. I depends where your urls are originating from.