Quote:
Originally Posted by Jean-Luc
wige: in my logic, your combination of a 404 with a built-in 301 as you suggested should not give the expected result. Is there a flaw in my logic ? 
|
Its a server hack. ErrorDocument simply tells the server what to do when a file is not found, letting you substitute the missing document with a custom document explaining the error, which exists at the requested URL, along with a header containing the 404 error code. The custom error document created in PHP overrides the 404 response code with a redirect response code.
User requests the missing page.
Server sees that the page does not exist, so responds to the request with the error document.
The PHP parser tells the server to override the "404 - Not Found" header with a "301 - Permanent Redirect" header
The user receives a redirect to the intended destination.
This allows you to create redirects as files are deleted without creating custom rewrite rules.