Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Changing http headers in cgi response

by Your Mother (Bishop)
on Sep 10, 2010 at 06:24 UTC ( #859597=note: print w/replies, xml ) Need Help??


in reply to Re^2: Changing http headers in cgi response
in thread Changing http headers in cgi response

I think you might be unclear what 202 means(?). It's not for "content" at all. It's for saying, "I got your request and I'll look into it and let you know; maybe here's a link or something you so you can check back when I'm ready with what you actually asked for."

You are trying to overload your web server to behave as your dispatcher. Don't do it. Use proper dispatch and server configuration. Here is an example (untested—pasted from a web sample—and might need correction) configuration for apache to point to a script (fastcgi in this case but CGI should work too)-

RewriteEngine On RewriteRule ^(/somedir/dispatch\.fcgi/.*)$ - [L] RewriteRule ^(.*)$ somedir/dispatch.fcgi/$1 [PT,L]

Then you can use the request URI (everything in the path after the script's name) inside your (F)CGI to do the things you're talking about wanting to do while returning proper status codes to match.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://859597]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2020-01-26 09:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?