diff options
Diffstat (limited to 'internal')
-rw-r--r-- | internal/server/server.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/server/server.go b/internal/server/server.go index b327f3d..ba825aa 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -194,10 +194,12 @@ func New(runtimeConfig *Config, log *log.Logger) (*Server, error) { path, _ := website.CanonicalisePath(r.URL.Path) newURL := config.BaseURL.JoinPath(path) http.Redirect(w, r, newURL.String(), http.StatusMovedPermanently) - } else { + } else if re.MatchString(r.Host) { url := config.BaseURL url.Host = re.ReplaceAllString(r.Host, replace) http.Redirect(w, r, url.String(), http.StatusTemporaryRedirect) + } else { + http.NotFound(w, r) } }) } else { |