summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tissue/web/server.scm14
1 files changed, 9 insertions, 5 deletions
diff --git a/tissue/web/server.scm b/tissue/web/server.scm
index fa26aa5..bfe3992 100644
--- a/tissue/web/server.scm
+++ b/tissue/web/server.scm
@@ -310,11 +310,15 @@ See `start-web-server' for documentation of HOSTS."
        ;; Static files
        ((let ((file-path
                (find file-exists?
-                     ;; Try path and path.html.
-                     (list (string-append (assq-ref host-parameters 'website-directory)
-                                          "/" path)
-                           (string-append (assq-ref host-parameters 'website-directory)
-                                          "/" path ".html")))))
+                     (if (string-suffix? "/" path)
+                         ;; Try path/index.html.
+                         (list (string-append (assq-ref host-parameters 'website-directory)
+                                              path "index.html"))
+                         ;; Try path and path.html.
+                         (list (string-append (assq-ref host-parameters 'website-directory)
+                                              "/" path)
+                               (string-append (assq-ref host-parameters 'website-directory)
+                                              "/" path ".html"))))))
           (and file-path
                ;; Check that the file really is within the document
                ;; root.