Let's state that I've got a form to look by multiple tags in wordpress.

<input type="checkbox" name="my_tags[]" value="tag1" />
<input type="checkbox" name="my_tags[]" value="tag2" />

I wish to allow it to be to ensure that when my wordpress plugin understands that my_tags[] is placed, it rewrites the request to express


I understand to make use of add_query_arg to set up the tag, and also to make use of the query_vars filters to permit my arguments to become sent, but exactly what do i hook into to obtain the arguments which were sent following the request, before wordpress parses the request?

My understanding is you wouldn't be 'replacing' the query in the present request, but instead developing a brand new request URI and redirecting the customer with wp_redirect() using the default 302 Found status code. Something similar to:

wp_redirect( add_query_arg( array( 'tag' => implode( ' ', $_REQUEST['my tags'] ) ), bloginfo('url') ), 302);

This kind of housekeeping needs to happen before headers are sent, clearly. May well spot to hook it in with the Wordpress plugin API will be the parse_request or send_headers actions. I am talking about, all you are doing here's parsing a request and delivering headers. :P

I understand nearly nothing about carrying this out having a server rewrite within the .htaccess file, though, so perhaps you may explore that a lot.