How to show block on pages with URLs containing a question mark ( 'searchquery' )? For example I end up with url's like

example.com/viewname?f=[0]field_name=%3A21


I want to make a block visible on pages like the above but not when only the view is displayed.

Only the view will looks like this: example.com/viewname

So my thought was to set the block visibility setting to be only visible on: 

example.com/viewname*

That didn't work ( block did not show up ) so i tried: 

example.com/viewname?* , example.com/viewname?f* and example.com/viewname/*

No success.

EDIT:

There are some options:

1) Creating a block in custom module could be a solution.

1a Setting visibility to 'none' by unsetting the block content and title ( which I have chosen to use for now )

1b Enabling the PHP filter module and adding a block setting visibility restrictions like so:

/**
  * Implements hook_block_info().
  */
function mymod_block_info(){
  $blocks['mymod_job_agent'] = array(
    'info' =&gt; t('block description'), //The name that will appear in the block list.
    'cache' =&gt; DRUPAL_CACHE_PER_ROLE, //Default
    'region' =&gt; 'sidebar_first', // assign block region
    'status' =&gt; 1, // enable the block
    'visibility' =&gt; BLOCK_VISIBILITY_PHP, // set visibility to use the result of pages
    'pages' =&gt; '&lt;?php return TRUE; ?&gt;',
  );
  return $blocks;
}


Drawback: since hook_block_info is called upon module install only you cant change your code without reinstalling the module. And putting php code in de pages just doesn't feel right.
So I think we can cross option 1b.

2) Another solution would be to use the Block Conditional Visibility by URI Query Parameters module but I couldn't figure out how to use this for this use case.

Reading the comments this is something that should be done in the theme layer...

Hope this helps anyone searching for a similar question. feel free to edit update my question/answer to improve it!
You can use the Block Conditional Visibility by URI Query Parameters module to control block visibility via query string.


  Controls block visibility by URI Query Parameters. Drupal natively allows blocks to be placed on pages by using their paths, however, this module allows administrators to also display modules based on url query parameters.