Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Redirect of search ends up in a 404 page sometimes.
This topic contains 2 replies, has 2 voices, and was last updated by Ernest Marcinko 5 years, 2 months ago.
- March 17, 2018 at 5:54 pm #17167
I have a search field on front-page witch is supposed to redirect to the main search page and there display the result. It works when I don´t enter any search phrase or if I enter one letter or two letters but with three letters or more I get redirected to a 404 page. But phrases like ?s=ease works but not ?s=lease (I have a post with a title like “Test Release”).
The search criteria is to search in title and custom field general_description.
I use a child theme and the parent is Divi-theme.
Question no 2:
Is it also possible to have a redirect when a user chooses a category from the category dropdown?
/StefanMarch 19, 2018 at 10:55 am #17170
Regarding question 1. I solved it by using a get querystring on the second page (search) like:
$frontpagesearch = sanitize_text_field( $_GET[‘frontpagesearch’] );
I will try to do something similar with question no 2.
Still curious to here what you have to say about my original question though.
/StefanMarch 19, 2018 at 12:18 pm #17174
1. I am thinking that the results override feature might not be enabled. In that case, the plugin will simply redirect to the results page, but will not override the search results with it’s own.
Add this custom code to the functions.php in your theme/child theme directory (copy from line 3 only!). Before editing, please make sure to have a full site back-up just in case!Best,
If you like my products, don't forget to rate them on codecanyon :)
You must be logged in to reply to this topic.