php - add_rewrite_rule wordpress with w3 total cache -
I want to rewrite the rule for SEO friendly. Here I have put my subject in function.php
add_action ('init', 'add_my_rewrite_rule'); Function add_my_rewrite_rule () {add_rewrite_rule ('^ quiz / ([^ /] *) / ([^ /] *)?', 'Index.php? Pagename = quiz and quiztitle = $ matches [1] and quizid = $ matches [2] ',' top '); } Add_filter ('query_vars', 'set_quiz_query_var'); Function set_quiz_query_var ($ vars) {array_push ($ vars, 'quiztitle'); Array_press ($ Wars, 'quizad'); Return $ Wars; }
Because this snippet was not working, I have also tried to rewrite the .htaccess rule.
revised rule ^ quiz / ([^ /] +) / ([^ /] +) $ / index.fip? Penzem = Quiz Mail Extracts = $ 1 & quizid = $ 2 [nc, r = 301, l]
I think this is due to the W3 total cache, I spent the whole night but could not understand it alone ....
Flush the rules of rewriting - - Go to Settings permalinks and click on "Save"
Comments
Post a Comment