Issue with search URL rewrite
-
Hi,
I do rewrite my search URL like so
if ( is_search() && !empty($_GET['s'])) { wp_redirect(home_url("/find/") . urlencode(get_query_var('s'))); exit(); }and I just figured that the WP SEARCH is not working anymore. It brings up the next best available page or post ULR or the 404 page. Honestly I am not sure if polylang is causing the trouble, so this is just me asking if it could be since it is the one plugin that touches URLs.
Oh and when I remove the URL rewriting the search works fine again.
I run many more website with my exact same theme but no polylang plugin and there the search works perfectly fine.
Anybody an idea or even a fix?
Thanks a lot for your support.
Cheers, AlexPS
– when I ‘deactivate’ all plugins the search is still broken with the rewrite and works without the rewrite.
– also copied the rewrite code and the search.php template code from a site where it works fine to see if my code causes the trouble but the search was still broken
The topic ‘Issue with search URL rewrite’ is closed to new replies.