I have some forms submitting on the site and the return URL is set to /thank-you
When you visit this page normally, it shows up fine. But when the form redirects to it, sometimes it comes up with the Netfliy Page Not Found error. Is there a reason for this and any way to prevent it from happening? It is very intermittent and only shows the error sometimes. Other times it works okay.
The form POSTs to an external URL which then returns the user back to the thank-you page. Not sure if this is related to the issue?
Just worth nothing that this is a custom form, not a netlify form.
If you complete any test submissions, please prefix your name with TEST_ so that the client and filter it out of the submissions.
By custom form, I simply mean that it is not a âNetlify Formâ. It is a form that is generated through the CMS of the site via a third-party plugin called Freeform.
It is worth mentioning too, when you are on the 404 page, if you click on the browsers address bar and hit return, it will reload and show the correct page. So the page definitely exists.
hi there, sorry to be slow to get back to you, i think i understand what is happening - your form is being handled on a non-netlify server somewhere that then redirects back to the /thank-you page when it is done handling the form, but that these requests sometimes cause a 404, is that correct?
When you say that this worked before you ran the site on netlify, can you be more specific? do you mean you were able to run this locally, or was it live somewhere?
When we originally launched this is, we did not run it on a Netlify server. During this time, the form redirects worked correctly, and never brought up a 404 error on the thank-you page.
It is only since we have moved the site onto Netlify that this error has become an issue.
Is there a reason for that? Note that you wonât be able to do that as mentioned here. Can you try removing that rule and see if that improves your issue?
I added that redirect as an attempt to âfixâ the issue - the 404 was showing up prior to this redirect being in place.
For SEO reasons, we need to have trailing slashes at the end of all URLs. So it was an attempt to try to redirect from /thank-you when it was erroring on submission, to /thank-you/ which loads correctly. Obviously a bit hacky, but it didnât resolve the issue anyway, so might as well remove it.
I initially overlooked the issue, but it looks like you are setting your action as some url that is not part of your netlify-hosted site. The action needs to be an existing page on your netlify-hosted site. For example, you have a /thank-you/ folder with an index.html file in there so you can set your action to /thank-you/. Currently, our system isnât parsing your form successfully as shown here: Netlify App.
Regarding trailing slashes, just to reiterate the relevant doc here: Redirect options | Netlify Docs. Hopefully that helps you implement your site to match your needs.