Hi there,
We've created a page which houses a view. The view is passed a URL parameter via a query string like so:
hidden link
We'd like the URL to look like this:
hidden link
Is that possible via custom PHP code? Can I add a custom rewrite rule? I attempted to add a rewrite rule (below), but it didn't work:
add_action ( 'init', callback: , 'add_rewrite_rules', priority: 10, accepted_args: 0 ) ;
function add_rewrite_rules ()
{
add_rewrite_rule('^(inside-out-archive-experiment)/([0-9]{4})/?$', 'index.php?pagename=$matches[1]&prog-year=$matches[2]','top');
}
add_filter ( 'query_vars', 'add_query_vars' );
function add_query_vars ($vars)
{
$vars[] = 'prog-year';
return $vars;
}
Thank you.
Saul
![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2080%2080'%3E%3C/svg%3E)
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Hello. Thank you for contacting the Toolset support.
View's URL param are required to filter views correctly as well as for pagination hence there is no such feature to rewrite the view's URL param.