Wordpress custom Querystrings & Pretty URL's - How?
snippet in htaccess

Wordpress custom Querystrings & Pretty URL's - How?

user5091

<?php
add_action('init', 'add_my_rewrite');

function add_my_rewrite() {
    global $wp_rewrite;
    $wp_rewrite->add_rule('location/([^/]+)/code/([^/]+)','index.php?loc=$matches[1]&code=$matches[2]','top');
    $wp_rewrite->flush_rules(false);  // This should really be done in a plugin activation
}