add_rewrite_rule wordpress with w3 total cache
问题 I am trying to rewrite rule to seo friendly. Here is the code I put in my theme function.php add_action('init', 'add_my_rewrite_rule'); function add_my_rewrite_rule(){ add_rewrite_rule('^quiz/([^/]*)/([^/]*)?','index.php?pagename=quiz&quiztitle=$matches[1]&quizid=$matches[2]','top'); } add_filter('query_vars','set_quiz_query_var'); function set_quiz_query_var($vars) { array_push($vars, 'quiztitle'); array_push($vars, 'quizid'); return $vars; } Because this snippet didn't work, I also tried to