How do you get cruft free URIs for search results?

To return clean URIs for search results in WordPress from the search form ( instead of

First create a file called search.php which contains:

<?php header('Location:' . $_GET['s']); ?>

Put that file in the root of your WordPress install and alter the action for the search form to this:

action="<?php bloginfo('url'); ?>/search.php"

See also: