I would like to rewrite url and pass parameters in URL (GET) on wordpress (nginx server).
In functions.php i add this:
add_action('init', 'add_my_rewrite');
function add_my_rewrite()
{
global $wp_rewrite;
add_rewrite_tag('%jeans%','([^&]+)');
$wp_rewrite->add_rule('catalogue/([^/]+)/','index.php?pagename=catalogue&jeans=$matches[1]','top');
$wp_rewrite->flush_rules();
}
Then in my php file id this:
global $wp_query;
$jeans = $wp_query->query_vars['jeans'];
echo $jeans;
But it doesnt works