rewrite and template_redirect
-
I have used the nicename permalinks for some time and it works like a charm. I use the /%postname%/ structure.
I have written a plugin that:
add_action('template_redirect','miljo_redirect'); function netwrok_redirect() { if(isset($_GET['network']) { include(TEMPLATEPATH."/network.php"); exit(); } }
How can i make the https://www.wordpressblog.com/?network rewrite to https://www.wordpressblog.com/network/
AND make the template_redirect detect the /network tag?I’ve tried to resolve the rewrite with:
add_action('generate_rewrite_rules','network_add_rewrite_rule'); function network_add_rewrite_rule($wp_rewrite) { $new_rules = array('natverk/(.+)' => 'index.php?natverk='.$wp_rewrite->preg_index(1) ); $wp_rewrite->rules = $new_rules + $wp_rewrite->rules; }
But it doesnt work.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘rewrite and template_redirect’ is closed to new replies.