Alter Drupal search URL I have a third-party vender that provides particular information for us when queried.

Basically, we need to change the URL of the search results page so that their supplied javascript can contact their site and return results from searching the same term.

So if I searched for polar bears the resulting path would normally look like this
http://foo.com/search/node/polar%20bears

I need to append to the path like this
http://foo.com/search/node/polar%20bears?scq=polar%20bears
or 
http://foo.com/search/node/polar%20bears?scq=polar bears

How would I accomplish this?
When you want to alter the behavior of an existing form, hook_form_alter() is a useful tool here. Here you want to alter the existing form so that the redirected URL has an extra query parameter. By looking at the submission handler we can see that the search form uses drupal_redirect_form() to go to the /search/node/SEARCH_TERM path.

We can add an extra submission handler to this search form so that it modifies the redirect path with the extra query parameter. 

Here's an example MYMODULE that would do as such for the search block form. 

/**
 * Implements hook_form_alter().
 */
function MYMODULE_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  // Add an extra submission handler the search block form.
  if ($form_id == 'search_block_form') {
    $form['#submit'][] = 'MYMODULE_search_box_form_submit';
  }
}

/**
 * search_block_form submission handler
 */
function MYMODULE_search_box_form_submit($form, &amp;$form_state) {
  $form_state['redirect'] = array($form_state['redirect'], array(
    'query' =&gt; array(
      'scq' =&gt; $form_state['values']['search_block_form'],
    )
  ));
}