Forum Moderators: phranque
Is there a way to have some code that if someone goes to a page that is a 404, it runs an SSI.
As an example, if someone went to the webpage www.url.com/test1.shtml, the 404 would load the following:
#include virtual=" page.cgi?test1.shtml
On the other hand, if someone went to the webpage www.url.com/test2.shtml, the 404 would load the following:
#include virtual=" page.cgi?test2.shtml
In needs to be generic enough that if someone types in something completely random such as www.url.com/dsfhjsdf.shtml, the 404 would load the following #include virtual=" page.cgi?dsfhjsdf.shtml
Thanks
Perhaps you could replace the requested page name in your SSI examples above with ${REQUEST_URI} to get the file/page requested by the visitor.
<!--#include virtual="page.cgi?${REQUEST_URI}" -->
I haven't tried it. It might be missing quotes or other syntax-required characters. It might not work at all. But I did something like what you're describing several years ago, and it wasn't too terribly involved.
Jim