Contact Form Working on wordpress but not working on actual website

Hello there so I have a problem and I’m not sure how to solve it.
I have a website which is hosted thru netlify but I’ve built it using wordpress and when I’m filling the contact form on word press it would send me an email and show me the msg that the email was sent and I recieve the email but I when I’m connecting to the webpage thru virtusage.co.uk and I fill out the contact form after clicking on send I’d get page not found 404 error. How do I solve this? Oh and I’m currently using wp mail smtp plugin mby that’s the issue.
Thanks in advance

@Hambi If you check the code for your contact form you will see that it is configured to POST to /wordpress/contact/

This will work when you’re running it on a PHP server as the /wordpress/contact/ route is likely a PHP script which catches the submitted form values and sends the email.

This won’t work on Netlify, since Netlify doesn’t provide runtime PHP hosting, and if you visit that route (which the form does when you submit), you’ll see that it is a 404 error.

Based on all the class names in your front-end code it’s likely your form is being output by a plugin so may be difficult for you to adjust, but on Netlify you should either adjust your form to use Netlify Forms or if you have more complex requirements have your form call a custom Serverless Function to perform whatever actions you would like.

1 Like

Hi @nathanmartin, great debugging skills. I hope this helps @Hambi