Forums

Search not working - redirects to index.php (7 posts)

  1. librarygrrrl
    Member
    Posted 3 years ago #

    Site in question: http://www.librarygrrrl.net/index.php

    When I enter a search into the search box on the top right of the page, it sends a query but then redirects back to index.php and gives no results.

    http://www.librarygrrrl.net/?s=hockey redirects right back to
    http://www.librarygrrrl.net/index.php

    I have changed themes, disabled all my plugins and re-enabled them one-by-one, and this issue still persists. I've replaced the search code in my header.php file with the searchform.php file in the default and the same redirect to index.php happens. I've searched in the forums and have found one post that seems like it could make my life much better if I could get my search to send a query the way it is formatted: http://wordpress.org/support/topic/207270

    For exmaple, these both work, while the search query above does not. http://www.librarygrrrl.net/index.php?s=hockey&submit=search and http://www.librarygrrrl.net/index.php?s=hockey

    I think this means that my search.php page is working correctly. But how do I get my searchform to include index.php in what it passes as a query?

    Does anyone have any idea what could be going on? I'm really confused!

  2. krembo99
    Member
    Posted 3 years ago #

    I see you have the wordpress installation in a sub directory ..
    How did you include the search form in your template ?

  3. librarygrrrl
    Member
    Posted 3 years ago #

    The search form (or the code that replicates what's in most searchform.php files) is included in the header.php file. This is what that code looks like:

    <form id="searchform2" method="get" action="<?php bloginfo('home'); ?>">
    
    <input type="text"  onfocus="doClear(this)" value="<?php _e('search'); ?>" name="s" id="s" size="18" /> <input type="submit" value="<?php _e('Go'); ?>" />
    
    </form>

    Could this be my issue?

  4. krembo99
    Member
    Posted 3 years ago #

    NO/// this is not the issue, but I think I understand what the issue is ...

    In your wordpress general setting, where it say
    Blog address (URL)
    do you have
    http://www.librarygrrrl.net/
    or
    http://www.librarygrrrl.net/index.php

    you should have the first one (with no index.php)

    in the WordPress address (URL) you should have
    'http://www.librarygrrrl.net/wordpress/'
    (or at least this is where i saw your real install was)

  5. librarygrrrl
    Member
    Posted 3 years ago #

    Thanks krembo99. That's a good hunch, but my settings are correct -

    blog address: http://www.librarygrrrl.net
    and
    wordpress address: http://www.librarygrrrl.net/wordpress

    Do you (krembo99) or anyone else have other suggestions or places to look? For some reason, I *want* to blame this on my permalinks. Does that hunch ring any bells?

    I continue to be moderately puzzled.

  6. Developer ICAN
    Member
    Posted 2 years ago #

    Hi - have you managed to fix this yet? - i'm having the exact same problem? http://www.newirelandlimousines.com/?s=touring

  7. acrane
    Member
    Posted 2 years ago #

    I had this problem and below is what fixed mine.

    line 124 -> wp-includes/general-template.php

    change

    $form = '<form role="search" method="get" id="searchform" action="' . get_option('home') . '/" >

    to

    $form = '<form role="search" method="get" id="searchform" action="/index.php" >

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.