I'm working on a project which involves filtering some customs posts on the front-end. I managed to create the permalinks including a custom field, but it seems that the rewrite rule matches some unwanted pages, making them not display-able on the frontend.
The code I use for rewriting :
$wp_rewrite->add_rewrite_tag('%competition%', '([^/]+)', 'competition='); $wp_rewrite->add_rewrite_tag('%prize_category%', '([^/]+)', 'prize_category='); $wp_rewrite->add_permastruct('competition', '/au/%prize_category%/%competition%/', false);
The problem is the following. It does what it should do for this url:
But it also matches this one:
Is there anyway I could force the second parameter
%competition% to be mandatory? So the rule will apply only for URLs like:
http://example.com/au/param1/param2 not for