
vpendrak
New User
Sep 4, 2009, 11:36 AM
Post #1 of 3
(1280 views)
|
Location command in Perl - what's 'wrong' with it?
|
Can't Post
|
|
Hi, I'm re-writing a Perl code created by someone else (within a code somecode.cgi) and found something interesting. I came upon a 'Location' command that normally redirects you to a specified page : print "Location: http://www.yyy.com/temp/index.htm\n\n"; which could be equivalent to: print "Location: index.htm\n\n"; if the cgi is executed under http://www.yyy.com/temp/ up until now, it is understandable. My confusion comes when instead of .htm file I used .php extension (a htm version with some php code in it). Used in the above context, it actually WORKS (executes) as a regular PHP code. On top of that, when a relative path is being used, the address bar in a browser does not show the index.php (htm) file but it stays with an original cgi script that was called. Which makes me question.....is this a normal behavior for Apache to interpret this file as a php (since this is not a web request) and is there any documentation about it? I'm writing this post because this solution would save a great deal of work for whatever I'm working on but since this is viewed as a bug (on a Apache side) by my manager, it cannot be implemented. Any help is appreciated. Thanks
|