--- return.c	Tue Oct 17 20:27:38 2000
+++ return.c.new	Thu Jan 18 04:57:13 2001
@@ -785,12 +785,17 @@
 {
     Ns_DString ds, msg;
     int        result;
+	char *hstname;
 
     Ns_DStringInit(&ds);
     Ns_DStringInit(&msg);
     if (url != NULL) {
         if (*url == '/') {
-            Ns_DStringAppend(&ds, Ns_ConnLocation(conn));
+/* Ns_DStringAppend(&ds, Ns_ConnLocation(conn)); */
+		if ((hstname = Ns_SetGet(conn->headers, "Host"))) {
+			Ns_DStringAppend(&ds, "http://");
+			Ns_DStringAppend(&ds, hstname);
+			} else Ns_DStringAppend(&ds, Ns_ConnLocation(conn));
         }
         Ns_DStringAppend(&ds, url);
         Ns_HeadersPut(conn, "Location", ds.string);
