Lately, I'm seeing some odd incoming traffic (not a lot, maybe 50 hits a day) from urls that don't exist. They seem to be kind of consistent like in the form of:
http://www.mysite.com/directory/filename.html?pagewanted=all
or
http://www.mysite.com/directory/filename.html?Layout=printer
The majority of the errors seem to be from Googlebot. My question is, should I be 404'ing them to the 404 not found page or 301'ing them to the correct url (http://www.mysite.com/directory/filename.html which actually does exist)? Or, should I send a 404 header but redirect (php) to the correct url? If it's an actual user coming in I'd want them to find the correct page, but if I do that - won't Google just keep spidering them? Or, do I specifically tell google only that they never existed but redirect for the non spidering user?
To recap, it seems like my options are:
1) send 404 header - redirect to 404 not found page
2) send 301 header - redirect to correct page (for which there has always been one based on these particular errors)
3) send 404 header - redirect to correct page (or is that bad for Googlebot?)
4) send varied header - 301 for user with redirection to correct page, 404 for googlebot and redirect to 404 not found page
Also, I should stress that it's not just googlebot that I'm seeing these errors from, but it is the majority of the errors. I am seeing some actual users following these links and similar ones from somewhere.