Redirecting on ErrorDocument

  • Looked into redirecting when ErrorDocument is called. Doesn't look like it'll work

I thought it might be possible to direct the users to the proper Clearquest schemea and Context ID by trapping on ErrorDocument. Normally when a document is not found (i.e. error 404) Apache will display the ErrorDocument associated with error 404. I thought that that document could be a script that looked at the referer and then looked up in the table to see if the user entered a "group". so, IOW, if the user entered http://server/CSSD I could look up CSSD and see it refered to a Cleaquest schema and redirect them. If the group lookup failed then I could simply display a 404 error.

But alas, referer (passed in via the environment variable HTTP_REFERER) is only set if the user is coming from an existing page. Here most often users are typing in the URL or have the URL bookmarked. In either case referer is not set, and if it were it would be of no help anyway because it would not be from http://server/CSSD (since that page does not really exist).