Microsoft
Software
Hardware
Network
Question : Error Handler For 404
hai...
i configured apache to handle error 404.
In the config. file of apache i have given
ErrorDocument 404 /cgi-bin/missing_handler.p
l.
And i have written and place the perl pgm in the cgi-bin folder.
It works fine if i evoke on the server using a web browser
whenever i access the document which is not fiund in the server the server triggers the perl pgm.
But if i request the same from a browser on a different client machine, it throws 302 error. Then i simply tried to ErrorDocument 302 handler on the server. Then the client machne throws the 404 error. And when i tried both handler in the server, the clien throws 302 error.
I would like to trigger the error handler 404 whenever the request page is not there when it is accessed by a client mac. Normally the resources accessed are not htmls they are word docum. or pdf docum.
Would anyone help to trace this problem.
Thanks for your time and consideration
Rajesh
Answer : Error Handler For 404
I believe I remember you saying somewhere that you are using cgi/perl.....
Umm in this case suppose you want to display a file on MachineA to people on MachineB and MachineC, set the response type to the appropriate type via
print "Content type: text/html\n\n" ...or
print "Content type: image/gif\n\n" etc..
Now what you want to do is and im not sure of the exact synatx...
$thefile = "C:\x.html"; #Not sure if this would work.. but you can give it a try..
$thefile = "x.html";
my $data;
open(FILE, $thefile) or die "Unable to open $!";
while ($data =
){
print $data
}
close(FILE)
This effectively is like telling your computer to grab 'x.html'. You can do this for most types of files. O/W what you can also do is put the file:// under your web directory and then access it as a normal webfile relative to the root.
Random Solutions
I can't find free drivers to my compaq presario
What tools are available for complex searches beyond Google's capabilities?
Display Properties, Appearance, Windows and Buttons has lost "Windows XP Style". Only option is "Windows Classic Style".
Automatically Enable Macros
NET Framework 3.0 - should I install it on XP pro systems
Execute SQL Script using PowerShell
Automate the enabling of Microsoft Terminal Services Client Control ActiveX control, mstscax.dll, for TS2008 remote app
Highlight Command Button to Show Active
Reinstalled XP Pro - boot up gives "client mac addr" and dhcp with rotating line
difficulty with transparent GIF outputs