-/* $Id: cgi.c,v 1.17 2014/07/19 13:15:07 schwarze Exp $ */
+/* $Id: cgi.c,v 1.18 2014/07/21 15:44:22 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014 Ingo Schwarze <schwarze@usta.de>
* without any delay.
*/
printf("Status: 303 See Other\r\n");
- printf("Location: %s/%s/%s?",
- scriptname, req->q.manpath, r[0].file);
+ printf("Location: http://%s%s/%s/%s?",
+ HTTP_HOST, scriptname, req->q.manpath, r[0].file);
http_printquery(req);
printf("\r\n"
"Content-Type: text/html; charset=utf-8\r\n"
/* Example compile-time configuration file for man.cgi(8). */
+#define HTTP_HOST "mdocml.bsd.lv"
#define MAN_DIR "/var/www/man"
#define CSS_DIR ""
#define CUSTOMIZE_TITLE "Manual pages with mandoc"
#define CUSTOMIZE_BEGIN "<H2>\nManual pages with " \
"<A HREF=\"http://mdocml.bsd.lv/\">mandoc</A>\n</H2>"
-#define COMPAT_OLDURI Yes
+#define COMPAT_OLDURI Yes
-.\" $Id: man.cgi.8,v 1.5 2014/07/18 19:02:07 schwarze Exp $
+.\" $Id: man.cgi.8,v 1.6 2014/07/21 15:44:22 schwarze Exp $
.\"
.\" Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: July 18 2014 $
+.Dd $Mdocdate: July 21 2014 $
.Dt MAN.CGI 8
.Os
.Sh NAME
An ASCII string to be used for the HTML
.Aq TITLE
element.
+.It Ev HTTP_HOST
+The FQDN of the (possibly virtual) host the HTTP server is running on.
+This is used for
+.Ic Location:
+headers in HTTP 303 responses.
.It Ev MAN_DIR
A path to the
.Nm