Not work about wp add rewrite rule.
-
I tried to more for add rewrite rule.
i want to point this urldomain.com/pagename/value1
go to
domain.com/?pagename=10&value1=10
follow on this code
function rewrite_rule() { add_rewrite_tag('%value1%','([^&]+)'); add_rewrite_rule('pagename/([^/]*)/?','index.php?pagename=10&value1=$matches[1]','top'); } add_action( 'init', 'rewrite_rule' ); function add_query_vars_filter( $vars ){ $vars[] = "value1"; return $vars; } add_filter( 'query_vars', 'add_query_vars_filter' );
i don’t know why it not working?
How to solve that problem?Thank you for every answer.
[ No bumping please. ]
- The topic ‘Not work about wp add rewrite rule.’ is closed to new replies.