Page Cannot be Found” When Searching

I had a strange problem on this site. Every time I try to search it gave me “Page Cannot be Found”

Luckily there is an easy fix to this problem in 5.1.

  1. Disable the search block (Go to “administer -> site building -> blocks” for this)
  2. enable the search box (Go to “administer -> site building -> theme -> your theme” and enable the checkbox for search)
  3. then modify the page.tpl.php in this way:

instead of:

if ($searchbox) {…}

write:

if ($searchbox && arg(0) != ‘search’) {…}

in this way the searchbox will not be displayed on the search page.

Extracted from drupal.org/node/103909

Leave a Reply

Your email address will not be published. Required fields are marked *