From 12cc52f58c2f10c5c203ecd1f3929a0b618738fd Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Sat, 15 Jun 2019 10:09:50 +1000
Subject: [PATCH] update documentation about vhosts

---
 README.md | 33 +++++++++++++--------------------
 1 file changed, 13 insertions(+), 20 deletions(-)

diff --git a/README.md b/README.md
index 8ce968f..99b167b 100644
--- a/README.md
+++ b/README.md
@@ -72,7 +72,6 @@ on the root menu don't work make sure you are using the `-h HOSTNAME`
 parameter in your configuration (with a valid resolveable hostname
 instead of `HOSTNAME` - see INSTALL).
 
-
 ## Security
 
 Gophernicus has been written with high security in mind. There should
@@ -89,7 +88,6 @@ The `-nx` option prevents execution of any script or external file,
 and the `-nu` option suppresses scanning for and serving of `~user`
 directories (which are normally at `~/public_html/` for each user).
 
-
 ## Gophermaps
 
 By default all gopher menus are automatically generated from the
@@ -98,7 +96,6 @@ informational text along with the files, or if you want to completely
 replace the generated menu with your own you need to take a look at
 gophermaps. See the [README.gophermap](./README.gophermap) for more information.
 
-
 ## Gophertags
 
 A gophertag file can be used to virtually rename a directory. Let's
@@ -109,7 +106,6 @@ will show "bar" but the links will still point to "foo". This is
 useful for creating descriptive names for directories without
 littering the file system with spaces and weird characters.
 
-
 ## Personal gopherspaces
 
 Gophernicus supports users personal gopherspaces. If a user has
@@ -121,30 +117,31 @@ This is suppressed if the `-nu` option is given.
 In this case, any `~` entry which otherwise initiates listing
 of user directories will be displayed literally.
 
-
 ## Virtual hosting
 
 Gophernicus supports virtual hosting, or serving more than one logical
 domain using the same IP address. Since gopher (RFC1436) doesn't
-support virtual hosting this requires some clever (but mostly invisble)
-hacks.
+support virtual hosting this requires some hacks.
 
 To enable virtual hosting create one or more directories under your
 gopher root which are named after your domain names. The primary vhost
 directory (set with the `-h HOSTNAME` option) must exist or virtual
 hosting will be disabled. Then simply add content to the hostname
-directories and you're up and running.
+directories and you're (kind of) up and running.
 
-Almost.
+There is a serious issue with virtual hosting.
 
-To make gopher clients work properly with virtual hosting, create a
-root gophermap for each of your domains and include the "%" type
-character to create a list of all available virtual hosts (see
-README.gophermap). The generated virtual host links will be created so
-that standard gopher clients will find the correct domain even when
-they don't specifically tell the server which host they're trying to
-reach.
+As stated previously, RFC1436 dosen't support virtual hosting. Clients won't
+like it.
 
+How the virtual hosting works, is that it loops through the vhosts looking for
+the selector. As you might think, the root gophermap exists on all of the
+vhosts, meaning it might not use the correct vhost. There is currently no easy
+way to fix this.
+
+It is recommended to add '%' on a line by itself to the bottom of your root
+gophermaps. This will add "special" links of the format example.com/;example.com
+which forces the correct vhost. 
 
 ## CGI support
 
@@ -189,7 +186,6 @@ the PHP command line interpreter. In other words, PHP starts working.
 And don't use the CGI version of PHP as it outputs HTTP headers the
 gopher protocol doesn't have.
 
-
 ## Charset support and conversions
 
 Gophernicus supports three charsets: US-ASCII, ISO-8859-1 and UTF-8.
@@ -208,7 +204,6 @@ than pure US-ASCII. If you want to disable the conversion use the
 something else than US-ASCII just use for example the `-o ISO-8859-1`
 option.
 
-
 ## Selector rewriting
 
 Selector rewriting lets you rewrite parts of the selector on the fly.
@@ -243,7 +238,6 @@ monitoring systems. To ease up such integrations, Gophernicus
 supports HTTP requests of the server-status page using an URL like
 `http://HOSTNAME:70/server-status?auto` .
 
-
 ## TLS/SSL and proxy support
 
 As of version 2.3 Gophernicus supports the HAproxy proxy protocol
@@ -292,4 +286,3 @@ Example:
     accept  = :::7070
     connect = 127.0.0.1:70
     protocol = proxy
-