jQuery Ajax returning correct Response, but after redirect to 404 Error

As noted in the comments, you have a form that may not know where to go. In general, if you have a form to be submitted, you don’t need AJAX because the form’s action will handle the form submission as well as the next page. If you need something from the database before the form is submitted (like the available sizes and colors of the product the user selected), then AJAX is needed. Since we can’t see the code for the entire form, we cannot say for sure, but it’s possible you don’t need AJAX in this situation, and using AJAX is what is causing your failure.