cant understand how to rewrite url
-
Hey guys, I had read a lot of articles, guides & tips and still cant understand how to rewrite rule.
Here is what i got:
my url:my code in functions.php:
/* * Add rewrite tags */ function add_new_rewrite_tags() { add_rewrite_tag( '%index%', '([^/]*)' ) ; } add_action( 'register_special_query_vars', 'add_new_rewrite_tags' ); /*hooked to a previous function which gets vars from the url.*/ /* * Rewriting rules */ function query_rewrite_new_rules() { add_rewrite_rule( '^/([^/]*)', '?navopt=$matches[1]', 'top' ); } add_action( 'add_new_rewrite_tags', 'query_rewrite_new_rules');
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘cant understand how to rewrite url’ is closed to new replies.