summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cgi.c4
-rw-r--r--cgi.h.example3
-rw-r--r--man.cgi.85
3 files changed, 9 insertions, 3 deletions
diff --git a/cgi.c b/cgi.c
index 59e767e5..62641099 100644
--- a/cgi.c
+++ b/cgi.c
@@ -564,8 +564,8 @@ pg_searchres(const struct req *req, struct manpage *r, size_t sz)
* 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"
diff --git a/cgi.h.example b/cgi.h.example
index 4f7273b1..f4c78318 100644
--- a/cgi.h.example
+++ b/cgi.h.example
@@ -1,8 +1,9 @@
/* 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
diff --git a/man.cgi.8 b/man.cgi.8
index 624e0207..169b2ae2 100644
--- a/man.cgi.8
+++ b/man.cgi.8
@@ -189,6 +189,11 @@ element.
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