if you are trying to get http://www.myblog.com/currentpage/1 http://www.myblog.com/currentpage/2 then your function should be add_action(‘generate_rewrite_rules’, ‘currentpage_rewrite_rule_222’); function currentpage_rewrite_rule_222($wp_rewrite){ $newrules = array(); $new_rules[‘currentpage/(\d*)$’] = ‘index.php?currentpage=$matches[1]’; $wp_rewrite->rules = $new_rules + $wp_rewrite->rules; } and just keep your query_vars function the way it is. add_filter(‘query_vars’, ‘wpa3537_query_vars’); function wpa3537_query_vars($query_vars) { $query_vars[] = ‘currentpage’; return $query_vars; }