Forums

Moving the main blog breaks searching? (2 posts)

  1. dthought
    Member
    Posted 6 years ago #

    Hi,

    I've decided to try something a little different with WordPress. That is, have all pages relative to / whilst moving the main 'blog' area to a folder, eg. /blog/

    I've used the reference on Pages in the WP Codex to get the new index working and all appears to work well, until you search.

    For a start, searching by default goes to
    /?s=search

    I have changed that, by modifying the template, to
    /blog/?s=search

    But that returns 404 errors every time.

    However,
    /blog/index.php?s=search
    works. Huh?

    I added in an echo at the top of the /blog/index.php file, and the 404 page is being thrown by the /blog/index.php file... but why /blog/?s=blah does not work and /blog/index.php?s=blah does, is unclear to me.

    Any thoughts on the matter would be appreciated :)

    Thanks.

    Update:

    /blog/?s=blah

    has this added condition: AND (ID = '157')
    in the database SELECT query condition (amongst other differences), whereas

    /blog/index.php?s=blah

    does not.

    I wonder why? Time to go a huntin'.

  2. dthought
    Member
    Posted 6 years ago #

    Update #2: Getting warm.

    When /blog/?s=blah is viewed, the db query ($q, bad variable naming guys :P ) uses Array ( [s] => blah [pagename] => thoughts )

    But when /blog/index.php?s=blah is viewed, the db query does not have the pagename.

    Hmm... the plot thickens.

Topic Closed

This topic has been closed to new replies.

About this Topic