If wordpress search not found redirected to /url and Not Found error

I been trying to fix this error but I am having no luck at all.

I am developing a WP theme and everything works fine except when I try to search for something that will return 0 results. When there are results everything works fine.

Read More

If there are 0 results WP redirects me to http://mywebsite.com/url displaying a “Not Found” error.

Here I copy my code for searchform.php that may help someone willing to help me.

<form action="<?php echo home_url(); ?>" id="searchform" method="get" role="search">
<input type="text" id="s" name="s" value=""/>
<input type="submit" value="Search" id="searchsubmit" style="display: none;"/>
</form>

Related posts

Leave a Reply