I created a custom search form to find the posts by make use of wp_query.
The form action is redirect to a custom page template where the custom wp_query running. The search form is using get method to passing the variable.
<form method="get" id="customsearch" action="<?php echo get_page_link( 3180 ); ?>"> //form input here. </form>
Somehow, the form was not redirected to the desired page, instead it went to homepage, when the permalink structure set to default.
If I set the permalink other structure, like Numeric or Post name, it goes to the correct page, but url broken in paginated page. Eg:
www.example.com/search-page/page/2/?formsubmit=submit(the GET data stripped)
Any idea why this happened?
- The topic ‘Form submission redirect to homepage’ is closed to new replies.