cgi_redirect_uri(3)

πŸ’– cgi_redirect_uri(3) πŸ’–

okay bestie, welcome to the cgi_redirect_uri page from the cgi/cgi.h manual β€” yes it's a section 3 page, yes it's part of ClearSilver, and yes we're about to make redirecting people around your site look effortless. πŸ¦‹


✨ NAME ✨

cgi_redirect_uri β€” send an HTTP 302 redirect response πŸ’…

like. that's the whole job. send the 302. move the person. slay.


πŸŽ€ SYNOPSIS πŸŽ€

#include <cgi/cgi.h>

void cgi_redirect_uri (CGI *cgi, const char *fmt, ...)
                       ATTRIBUTE_PRINTF(2,3);

🌸 ARGUMENTS 🌸

  • cgi β€” the cgi struct, obviously, your whole main character of a context object 🫢
  • fmt β€” a printf style format, plus args, because variety is the spice of life ✨

🌈 DESCRIPTION 🌈

okay so cgi_redirect_uri will redirect the user to another page on your site. simple as that, no notes. 🧚

the way this version works is that it takes the full URL β€” and I mean the whole thing: protocol, domain, port, path. all of it. not just the little path bit. the entire URL. periodt. πŸ‘‘

and listen, bestie, this is the important part: as with all printf style commands, you should not call this with arbitrary input that may contain % characters 😭. if you're forwarding something directly, use a format like this instead:

cgi_redirect (cgi, "%s", buf)

that's it. that's the safety move. do it. πŸ’–


⭐ RETURN VALUE ⭐

None. nada. nothing. it returns void, she simply does not return a value, and honestly? iconic behaviour. πŸ’€βœ¨


πŸ¦‹ SEE ALSO πŸ¦‹

go read these too, they're all part of the same little friend group:


and that's the page!! πŸŽ€ this one came to you courtesy of ClearSilver, dated 12 July 2007 β€” yeah she's a lil vintage but she still ate, and she's still serving 302s like it's nothing. bye bestie, go redirect responsibly πŸ’–βœ¨πŸ¦‹