I have been considering using a php script as a 404 page and a database to match URI of original page to a possible redirect if it exists (else display 404 HTML).
I was doing some reading and searching and came across this question 301 redirect with PHP and MySQL on 404. Which pretty much is what I was looking to do.
I had a question that led on from this and had prevented me attempting to implement it. At what point would crawler be informed that a page is 404?
I am wanting to assume that the client (be it a user or bot) would request the page, the server would fetch the 404 script+page, parse the php and then either return 404 page or matched redirect page to the client. Is this right? Would the client be oblivious to the 404 status until the page was returned?
Yes. You can’t know that you will get a 404 error until you get a response to the request.