0

I'm trying to implement simple search on our blog. Previously we'd used the Google Custom Search Engine, but since they removed the pay as you go option to remove ads, competitor ads are showing up in the search results. So, I haven't been able to get simple search to work.

I've previously posted here (Simple search form action is main _site page) and wasn't able to resolve it. The one reply to that post didn't work. I'm coming back to this at the turn of the tide to try and get it actually working.

We use Transcribe since we have bilingual website, because Canada. I've tried the solution found here: Search refer to homepage, which hasn't worked. I also tried disabling Transcribe, and seeing if that would resolve it, but no.

I would reply to this issue (Simple Search: search form redirects to home page), to get more details as to what exactly was wrong with their server setup, but I don't have enough reputation to reply.

Here is my search form code, which appears on the main listing of blog entries.

{exp:search:simple_form channel="blog" name="blog_search"
        result_page="blog/search" no_result_page="blog/no-results" results="10" 
        search_in="everywhere" show_expired="yes" status="open" where="all" 
        form_id="blog_search" form_class="blog_search" transcribe_add_lang="en"} 
    <input type="text" name="keywords" id="keywords" value="" size="18" maxlength="100">
    <input type="submit" value="submit" class="c_btn--s v_bg--green-grad">
{/exp:search:simple_form}

I've tried changing result_page to "/blog/search", "/en/blog/search", and "{transcribe:language_abbreviation}/blog/search", and no_result_page was changed to the same. I can browse to both blog/search (the default no search results EE message is displayed) and blog/no-results ("NO RESULTS" it screams at me). I've gone to the EE Slack channel and variations on the above suggestions have been passed my way.

Changing the form action to /blog/search in Chrome's Developer Tools will make the search work, but I don't know how to get it to do that programatically.

Could there possibly be a server set up error somewhere that is causing this to happen? Or could there be something in PHP that was incorrectly set up, or should be added? The .htaccess file is rather ... lengthy (mostly redirects from our old website to this due to change in structure), but I don't believe there's anything there that would cause it.

Running EEv2.10.3 - Build Date: 20160129.

2
  • Why don't you go for Low Search? Mar 13 '18 at 8:49
  • We're probably switching to our parent company's CMS within 6 months, so not the most efficient use of money (not my choice).
    – Amanda L
    Mar 13 '18 at 13:40
0

Okay, I figured it out, after smashing my head against my desk for most of the day, and having Derek talk me through it in the #eecms Slack channel.

It looks like my issue was I had something in my .htaccess file that caused the redirect. We are/were using NSM .htaccess Generator, and there was a line like this in the file:

# Directs all EE Web requests through the site index file
    RewriteCond %{REQUEST_URI} ^/({all template channels pipe delimited here}|P[0-9]{2,8}) [NC]

Removing/Commenting out that line fixed the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.