use args or captures to pick search terms on 404

Rather than cutting off two path segments and using the rest to pick
suggested search terms, use all of the arguments or captures from the
last action.
Merge pull request #1283 from haarg/404-search-terms

use args or captures to pick search terms on 404