Htaccess 404 correct syntax and effect on SEO?

For years now my htaccess has been referring requests to missing pages to an error page using an absolute url

ErrorDocument 404 http://www.mywebsite.com/404.php

This had the effect of serving a 302 redirect pointing to the error page, which then issued the 404 header, for any requests to missing pages.

Eg I request www.mywebsite.com/missing_page.html and the server redirects the browser to www.mywebsite.com/404.php, which issues a 404 header.

The other day I thought that redirecting the browser to the error page might not be the right way, and I realised that by using the path from the server root eg

ErrorDocument 404 /404.php

the server would issue a 404 header, while keeping and keep the url as it is.

Eg I request www.mywebsite.com/missing_page.html and the server issues a 404 header, serves the page /404.php, and keeps the url as it is.

I thought this was the right way to go, and seems to be what other sites are doing.

However, this morning I noticed some of my pages dropping severely in the google serps. Is it at all possible that this change in serving error pages has given google the idea that there’s something shady about my site or pages?

I would say the two are likely to be unconnected.

Yes, you should ensure your server is configured to give a 404 response to an invalid URL. It sounds like that’s what you’ve now done, so that’s good.

Google will periodically check on whether you are doing this correctly, by requesting made-up URLs, and if it gets a 200 A-OK then it knows to be sceptical about unverified pages from that site. How it would react to a 302 —> 404 I don’t know.

If the drop you are seeing is in some way related to the changes you’ve made, it should at worst be a temporary blip as Google sorts its index of your site out properly.