ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Simple Search Stopped Working

October 22, 2012 11:03am

Subscribe [3]
  • #1 / Oct 22, 2012 11:03am

    Unbridled Books

    16 posts

    Hi,

    I have recently upgraded to 2.53 and I’m not exactly sure when it quit working, but I just noticed that the simple search is not working.  It just redirects you back to the homepage. 

    Also recently, I turned on “cloudflare” in my hosting plan.  This involved a change in the DNS to include “www” on the site. I had to go into the .htaccess file and modify this.

    So, I’m not sure which of these things caused the problem.  FYI, I have a development mirror site running on a different host, with Cloudflare, and upgraded to 2.53, that works fine.

    I have read all of the posts on subjects like this and tried a lot of them (including all the parameters in the tag).  Nothing has worked.

    Here is the code I’m using…

    {exp:search:simple_form channel="books" search_in="everywhere" result_page="search/custom_results" status="not closed" where="all" show_expired="yes" show_future_entries="yes"}
    
    <div id="topisbn">
     <font color="maroon"><b>ISBN, Title or Author:</b></font>
                  <input type="text" name="keywords" id="keywords" value="" size="18" maxlength="100" />
                  <input type="submit" value="submit" class="submit"  />
    </div>
    {/exp:search:simple_form}

    The results file I’m using has worked for years.  Let me know if you need to see it too.

    Thanks
    Warren Austin

  • #2 / Oct 22, 2012 8:29pm

    Shane Eckert

    7174 posts

    Hi there Warren,

    I am sorry to hear you are running into this problem.

    The first thing to check is that you are using www everywhere. In the config file, the Control Panel and in your htaccess file.

    Can you show me the contents of your htaccess file?

    Are you using strict URL?

    Please let me know.

    Cheers,

  • #3 / Oct 23, 2012 9:55am

    Unbridled Books

    16 posts

    Hi,

    I’m not using the www in the config file.  I tried putting it in there and instead of returning to the homepage, it takes you to a 404 when you try to search.  So I took it back out.

    Strict is not enabled.

    Here is a copy of the .htaccess file.  I have commented out the lines that used to take away the www.

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} ^/(stats|failed_auth\.html).*$ [NC]
    RewriteRule . - [L]
    </IfModule> 
    
    RewriteEngine On
    
    # Remove www from URLs
    # RewriteCond %{HTTP_HOST} ^www\.unbridledbooks\.com$ [NC]
    # RewriteRule ^(.*)$ <a href="http://unbridledbooks.com/$1">http://unbridledbooks.com/$1</a> [L,R=301]
    
    RewriteCond %{QUERY_STRING} ^(css=.*)$ [NC]
    RewriteRule ^(.*)$ /index.php?/%1 [L]
    
    RewriteCond $1 !^(images|site_index|img|scripts|sifr|audio|eecontrol|themes|favicon\.ico|robots\.txt|index\.php|sitemap\.php|y_key_f8705c01fa5604a0\.html|BingSiteAuth.xml) [NC]
    RewriteRule ^(.*)$ /index.php?/$1 [L] 
    
    ErrorDocument 401 /main/404/
    ErrorDocument 403 /main/404/
    ErrorDocument 404 /main/404/

    Any help would be greatly appreciated.

    Thanks
    Warren Austin

  • #4 / Oct 24, 2012 11:41am

    Shane Eckert

    7174 posts

    Hi Warren,

    How about the Control Panel, are you consistently using WWW in the Control Panel?

    It might be quicker if I log in and take a look. Would you be okay with that?

    Thank you,

  • #5 / Oct 24, 2012 12:35pm

    Unbridled Books

    16 posts

    I was talking about the control panel earlier when I called it the config file.  If you change it in there, it then gives a 404 when you try to use the search.

    As far as you logging in there, sure, no problem.  How do you want me to communicate the login and password to you?

    Warren

  • #6 / Oct 25, 2012 10:48am

    Shane Eckert

    7174 posts

    Hi Warren,

    Please be on the lookout for an email from EllisLab.

    Thank you,

  • #7 / Oct 27, 2012 9:02am

    Unbridled Books

    16 posts

    Shane,

    I see that you got it fixed.  The only changes I could see on the site were to the config.php file, but I couldn’t tell what you changed.  I’m dying to know what you found out.

    Thanks
    Warren Austin

  • #8 / Oct 29, 2012 3:23pm

    Shane Eckert

    7174 posts

    Hi Warren,

    Did you get the email from Robin?

    She mentions changing a few things, they are listed in the email.

    Cheers,

  • #9 / Oct 29, 2012 4:43pm

    Unbridled Books

    16 posts

    No, I haven’t heard anything.  I discovered it was working on Friday.  I would really like to know what she did.

    Thanks
    Warren

  • #10 / Oct 29, 2012 5:25pm

    Shane Eckert

    7174 posts

    Hi Warren,

    I will resend the email.

    Cheers,

  • #11 / Oct 30, 2012 11:03am

    Robin Sowell

    13255 posts

    Oops- sorry for the email confusion there!  Just to lay it out for anyone else, it was caused by a redirect.  I used Live HTTP headers, and saw that the post was getting a 301 response.  We need a 200- when it’s redirected, you lose all of the post data.

    I was a bit confused, because for the life of me I couldn’t figure out where that redirect was coming from.  But it was clear it was forcing the www- that’s what triggered it.  So- I changed the site url to include www, made sure the htaccess was not trying to muck w/www in any way, made sure index.php was not included (since the htaccess would redirect that)- and boom, it worked.

    And thanks to Warren’s private reply, I now know what the heck was forcing the www!

    The rewrite is being caused by a CNAME entry in the DNS settings for the site that is put there by CloudFlare.

    So- mystery solved!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases