We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5532
    • 251 Posts
    Hi There,

    We’re getting some weird search behavior when clicking headlines in some search results - the resulting page is blank but if you click the breadcrumb link it isn’t.

    - If you go to: http://eggs.co.nz
    - Type the search word "buy" in the box top right
    - Click the headline of the first result: "Where to buy"

    We get a blank page?

    But if you do the same thing and click the breadcrumb link for the first result, it works - or if you click the headline of the next result down "The SPCA Guarantee" it works.

    The site is live so obviously trying to sort this out ASAP - does anyone have any ideas?

    Any help would be much appreciated.

    Cheers

    Ben
      • 26016
      • 561 Posts
      Hi Ben,
      Wow, that’s a head-scratcher. Other searches seem to work well. As you can see, when Ajaxsearch pumps out its non-Ajax output, it makes links with lots of GET variables.

      I wonder if you’re inadvertently running into some kind of FURL or .htaccess issue. I did notice that the URL for the URL and the search query both contain the word "buy" in them when you use that search word. You could experiment by changing the alias of that page to something without "buy" in it, and then trying the search again. If it only works without that word, I suppose that would be a small SEO hiccup, but maybe not bad. You could also try shutting off FURL’s and see if the search begins to work.

      That’s admittedly a long shot, and someone who is an Ajaxsearch guru might have more insight.

      The good news is that using just the word "buy" in a search when that menu item is right in your face would be pretty unlikely. It’s truly a minor problem, IMO.

      I’ve always found Ajaxsearch to be a little mysterious. I had one client who had a site where they basically did a data dump of every bit of their tech sales literature. Silly minutiae that never gets read, I’m sure, something like 6 levels deep in the menu. Really stupid, but they would not be dissuaded. Their complaint re: search was something like "when I use the search word ’water’ we get too many pages of results". I suppose that the word "the" wouldn’t have been overly effective, either.

      Good luck, Dave
        MODx and Wordpress development
        Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
        • 5532
        • 251 Posts
        Hey Thanks for the reply,

        I’ve just changed the name of the page from "where to buy" to "where to purchase" and cleared the site cache. Now if you search for "purchase" the same thing happens! it must be something to do with that page - I might make a fresh new page and see what happens.

        Cheers

        Ben
          • 5532
          • 251 Posts
          OK, I created a fresh new resource and copied the content over and named it "where to buy"

          Now if you search for "buy" and click the headline link, it takes you to the page but the "Search Highlighting" part appears twice. Also, if you click the 3rd search result "our eggs" you get a blank page as well - this is a different page all together.

          I’m using Evolution 1.0.2 and here’s my AjaxSearch call in the search box:
          <div class="searchBox">
          <h4>Search:</h4>[!AjaxSearch? &ajaxSearch=`0` &AS_landing=`57` &AS_showResults=`0`!]
          </div>
          


          And on the page (in a plain text area - not rich text incase that matters):
          [!AjaxSearch? &ajaxSearch=`0` &AS_showForm=`0` &breadcrumbs=`Breadcrumbs,showCrumbsAsLinks:1,showCrumbsAtHome:1,currentAsLink:1` &extractLength=`700` &pageLinkSeparator=``!]


          This could be an .htaccess issue, I had a bit of trouble setting friendly URLs up but here is my .htaccess file incase someone can see something:
          Options +FollowSymlinks
          RewriteEngine On
          RewriteBase /
          
          # Fix Apache internal dummy connections from breaking [(site_url)] cache
          RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
          RewriteRule .* - [F,L]
          
          # Rewrite domain.com -> www.domain.com -- used with SEO Strict URLs plugin
          #RewriteCond %{HTTP_HOST} .
          #RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
          #RewriteRule (.*) http://www.example.com/$1 [R=301,L]
          
          # Exclude /assets and /manager directories from rewrite rules
          RewriteRule ^(manager|assets) - [L]
          
          # For Friendly URLs
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
          
          # Reduce server overhead by enabling output compression if supported.
          php_flag zlib.output_compression On
          php_value zlib.output_compression_level 5
          
          # For full documentation and other suggested options, please see
          # http://svn.modxcms.com/docs/display/MODx096/Friendly+URL+Solutions
          # including for unexpected logouts in multi-server/cloud environments


          Then in the host’s help section they say to use this with the following note: "Note: Please note the forward slash in the last line before the index.php. This is required on our servers." Their suggestion didn’t work during development so I might try this now the site’s live:
           RewriteEngine on
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^(.*)$ /index.php?id=$1 [L,QSA]


          Any pointers in the right direction would be great!

            • 5532
            • 251 Posts
            Tried their .htaccess suggestion but it didn’t work - just got a 404 error.