WordPress Rewrite

assuming u is a custom query var, you have to first add it to the array of recognized query vars: function wpa_query_vars( $query_vars ){ $query_vars[] = ‘u’; return $query_vars; } add_filter(‘query_vars’, ‘wpa_query_vars’); Then add an internal rewrite rule that accepts anything appended to vendors and passes that as the u query var: function wpa_rewrite(){ add_rewrite_rule( … Read more

Custom rewrite rules for a $_GET request

First add get to query vars array: function add_query_vars_wpa12572($vars) { $vars[] = ‘get’ return $vars; } add_filter(‘query_vars’, ‘add_query_vars_wp12572’); then add the rewrite rule function author_rewrite_rules_wpa12572( $wp_rewrite ) { $newrules = array(); $new_rules[‘get_(\d*)$’] = ‘index.php?get=$matches[1]’; $wp_rewrite->rules = $new_rules + $wp_rewrite->rules; } add_filter(‘generate_rewrite_rules’,’author_rewrite_rules_wpa12572′);

How do I create a dynamic page?

Here is the answer. And for future references, Deepak, you need to actually post the solution as an answer. Instead, you posted your answer within your own question and then made a comment about it. Please don’t do that. function analytics_rewrite_add_var( $vars ) { $vars[] = ‘analytic’; return $vars; } add_filter( ‘query_vars’, ‘analytics_rewrite_add_var’ ); function … Read more

How can I Rewrite a ‘page’ URL based on query string parameters?

You can add a rewrite rule such as the following. Make sure to register your public query vars with WordPress so it recognizes your rewrite rule vars. add_rewrite_rule(‘^(tips)/([^/]*)/([^/]*)/?’, ‘index.php?name=$matches[1]&id=$matches[2]&filter_id=$matches[3]’,’top’); add_filter(‘query_vars’, ‘foo_my_query_vars’); function foo_my_query_vars($vars){ $vars[] = ‘id’; $vars[] = ‘filter_id’; return $vars; } Visit the Permalinks Settings page to flush your permalinks. You can access your … Read more