Firstly, it appears, that there are some strong points that are wrong in your idea and possibly understanding of search. As your post and code shows, you only allow users to search for specific things. Correct me, if I'm wrong and your code operates in other ways, but..
Imagine this: a 10 year old boy from Kenya ends up on your site - how is he supposed to know what content your site contains? Or if he does, how is he going to try and find it? Yup, he uses search.
The first hit he gets, is a 404, because he searched for something that does not exist, and does not know that your site only allows to search for specific things, that exist. He leaves your site, unable to find the content he wanted.
This is not search's function. Search should allow you to search for everything, display a list of all possible results, and a polite error if none are found - definately not reditrect to a specific page immediately - instead, a generic page for all searches, or serve a 404 if said super-specific page does not exist.
I reccommend you look into Algolia or other similar products to facilitate search.
To fix your question's problem(s), however...
- You have a missing quotation mark at the class declaration of the button div. Will edit the Q to fix that.
- You really, really need to use indendation. It will make your code so much easier to read, and better and more appealing for others to help you. Will edit that aswell.
What you need, is a .htaccess file in your project root, with a defined 404 page, at the very minimum. Something like this, edited, to fit your 404 error page path and name. You will design and develop your 404 page as any other page. This will, hovever apply to ALL of your missing pages, so style and build it's content appropriately (see why a search results page is better, now?).
ErrorDocument 404 /404.html
If you happen to use nginx instead of apache, do this instead in your server configuration:
error_page 404 /404.html;
Alternatively, you could build a form around the search, and send the query string (which is a fancy word for the string the user searches for) to some PHP script of yours, which could determine if there are results to show, or not and display appropriate content - again, this could also be done with Algolia or similar - just parse and feed it your content in an appropriate form.