View Single Post
  #14 (permalink)  
Old 05-09-2008, 11:23 AM
wige's Avatar
wige wige is offline
Moderator
WebProWorld Moderator
 

Join Date: Jun 2006
Location: United States
Posts: 1,846
wige RepRank 4wige RepRank 4wige RepRank 4wige RepRank 4
Default Re: Discontinued products / broken links

Quote:
Originally Posted by Jean-Luc View Post
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.
__________________
The best way to learn anything, is to question everything.
Reply With Quote