Support » Fixing WordPress » Any search results in "object not found error"

  • Resolved bl00513

    (@bl00513)


    I’ve inherited a wordpress site, currently running only in production. I’m new to wordpress, so any help is very much appreciated! It’s running on SUSE/Apache/MySQL. From the looks of it, we’re using a custom developed theme. Seemingly everything (frontend and backend) is working fine on the site, except for the search. Whenever I search for anything, I get the “object not found” error from apache. I’m assuming it has something to do with the permalinks. When I search for “some phrase”, the url redirects to /search/some%20phrase. The rest of the site uses the default permalink syntax. I’m really not even sure where to start looking in order to troubleshoot this. On the otherhand, permalinks may have absolutely nothing to do with my problem. Any suggestions?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Can you replicate the problem using the default Twenty Twelve theme with all plugins deactivated?

    I’ll setup a local copy and check it out. Good suggestion.

    Okay, I got a local copy of my site setup. Per esmi’s suggestion, I disabled all of the plugins and changed the theme to Twenty Twelve. The search works just fine when I do this. I notice that the permalinking structure is different now. Previously, searches followed this structure “mydomain.com/search/myquery”. With the stock theme and no plugins the structure looks like this “mydomain.com/?s=myquery&submit=Search”. Is this something that is defined in my theme? Where should I start looking? It kind of look like POST is being used in place of GET somewhere, but I don’t know.

    Is this something that is defined in my theme?

    It shouldn’t be. That’s really plugin territory.

    Where should I start looking?

    Where did you download your theme from?

    I tried searching with all of my plugins enabled, but using the twenty twelve theme, and everything worked. I’m pretty sure it isn’t the plugins. The theme was custom developed for us. I’ve reached out to the design company that did the work, but they’ve been unwilling to help.

    I’m sorry but the wordpress.org support forums are meant for the core application, themes and plugins that are distributed on wordpress.org. We do not support themes from elsewhere and we cannot really help with de-bugging custom themes. If you cannot manage this yourself, you may want to consider hiring someone.

    Do themes typically adhere to a particular structure or convention? I don’t expect the wordpress community to maintain my custom code, but if you could point me in the right direction it would be much appreciated. For instance, is the search function usually handled with a certain method or located in a certain file? I feel confident that I’ll be able to correct the problem on my own, but I’m not really sure where in the them things like that are handled.

    Do themes typically adhere to a particular structure or convention?

    Themes hosted here do and it is quite strictly enforced to ensure theme quality and a good standard of cross-theme behaviour. However, a custom theme could be doing anything it wants to and may not follow any best practices or guidelines. In short, custom themes are a huge unknown.

    Moderator keesiemeijer

    (@keesiemeijer)

    Search all your theme files for something like ‘redirect’, or ‘rewrite’. Maybe you find the redirect code.

    Also try looking in your .htaccess file if there are any rewrite rules with ‘search’ in them.

    Thanks to both of you. I’ll check out the theme and see if I can locate the redirects as you suggested. This is definitely a start.

    For anyone that might happen across this thread… I found the solution to the problem I explained. There was a function in /themes/mytheme/inc/cleanup.php called “nice_search_results” that was attempting to redirect the url to an SEO url. I was able to simply comment out the function, and my search works like a champ now.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Any search results in "object not found error"’ is closed to new replies.