GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
HTTP_SERVLET_REDIRECT(3) FreeBSD Library Functions Manual HTTP_SERVLET_REDIRECT(3)

http_servlet_redirect
HTTP redirect servlet

PDEL Library (libpdel, -lpdel)

#include <sys/types.h>
#include <stdio.h>
#include <netinet/in.h>
#include <openssl/ssl.h>
#include <pdel/http/http_defs.h>
#include <pdel/http/http_server.h>
#include <pdel/http/servlet/redirect.h>

struct http_servlet *
http_servlet_redirect_create(const char *url, int append_url);

http_servlet_redirect_create() creates a new servlet that responds to all queries with an HTTP "302 Found" status code and supplies the new redirect URL url in the "Location" header. This causes the client to retry the transaction at the new URL.

The append_url argument determines whether and how the originally requested URL is included in the redirect URL and may equal one of the following:

url is always returned unmodified; the originally requested URL is discarded.
The query string component of the originally requested URL is appended to url as additional query string argument(s).
This causes the path and query string components of the originally requested URL (i.e., the URI) to be appended to url, in effect mapping the original URL into the corresponding "subdirectory" of url.
The originally requested URL is URL-encoded and appended as an additional query string argument to the redirect URL url. This is useful for example when redirecting to a login page that will redirect back to the originally requested URL after a successful login.

On failure, http_servlet_redirect_create() returns NULL and sets errno to an appropriate value.

http_request(3), http_response(3), http_server(3), http_servlet(3), libpdel(3)

The PDEL library was developed at Packet Design, LLC. http://www.packetdesign.com/

Archie Cobbs ⟨archie@freebsd.org⟩
April 22, 2002 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.