• Hey there,

    I’m currently experiencing an issue with the search result page when adding a space into the search term. The predictive search works, but if the item you’re looking for isn’t in the X results you show predictively, then you have to go to the search results page which is where the problem arises.

    Steps to reproduce:

    • Search Contact Us.
    • Press Enter.

    The search box will now show Contact%20Us and the url shows Contact%2520Us.

    The results line will say Showing results for: Contact%20Us

    Thanks

    Edit: Just to clarify, I have cleared all caches as per the sticky.

    • This topic was modified 8 years, 5 months ago by colincwc. Reason: Cache Cleared
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter colincwc

    (@colincwc)

    Can’t edit/delete my original post.

    For anyone having this issue, if you’re using a rewrite via functions.php and htaccess, ensure that you have the NE flag in htaccess.

    Example:

    RewriteCond %{QUERY_STRING} \\?s=([^&]+) [NC]
    RewriteRule ^$ /search/%1/? [NC,R,L]

    should be
    RewriteCond %{QUERY_STRING} \\?s=([^&]+) [NC]
    RewriteRule ^$ /search/%1/? [NC,R,NE,L]

    Easily resolved oversight in htaccess.

    Thanks!

    Plugin Author wpdreams

    (@wpdreams)

    Hi!

    Thanks for clarifying, I was worried what could have caused this, as I was unable to re-create the issue.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Space in search fails’ is closed to new replies.