WordPress.org

Ready to get started?Download WordPress

Forums

Search results redirect to home page (3 posts)

  1. NatalieLx
    Member
    Posted 1 year ago #

    We did a full site backup of one of our sites and restored it into a backup directory which looks identical to the original site.

    We noticed that when we do a search (on the backup site) and the search results exceed one page the first page of results displays correctly but when clicking on the link to retrieve the second page, instead of displaying the second results page it redirects to the home page, yet the page address displays correctly.

    First page of results shows as this:

    http://oursite.com/?s=news and returns the results correctly

    clicking on the retrieval of the second page of results shows this:

    http://oursite.com/page/2/?s=news but displays the home page of the site.

    (note we just changed our actual domain name to oursite)

    The strange thing is that the permalinks are set by Post Name when it doesn't work. If we change the permalinks to the Default setting then the search works correctly when retreivieng multiple pages of search results.

    We have seen multiple posts about this issue in the forum dating back several years but none seem to have an actual solution.

  2. NatalieLx
    Member
    Posted 1 year ago #

    one more thing. the search code we use in the sidebar is

    <form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
    <input type="text" size="15" value="<?php the_search_query(); ?>" name="s" id="s" />
  3. NatalieLx
    Member
    Posted 1 year ago #

    Just tried to play around with the permalinks again and the search only works when set to the Default setting. 2nd page search results do not work correctly when using the Day and Name, Month and Name, Numeric and Post Name settings.

Topic Closed

This topic has been closed to new replies.

About this Topic