diff --git a/hakyll.cabal b/hakyll.cabal
--- a/hakyll.cabal
+++ b/hakyll.cabal
@@ -1,5 +1,5 @@
 Name:               hakyll
-Version:            3.1.2.3
+Version:            3.1.2.4
 
 Synopsis:           A simple static site generator library.
 Description:        A simple static site generator library, mainly aimed at
diff --git a/src/Hakyll/Core/Writable.hs b/src/Hakyll/Core/Writable.hs
--- a/src/Hakyll/Core/Writable.hs
+++ b/src/Hakyll/Core/Writable.hs
@@ -20,6 +20,9 @@
     -- | Save an item to the given filepath
     write :: FilePath -> a -> IO ()
 
+instance Writable () where
+    write _ _ = return ()
+
 instance Writable [Char] where
     write = writeFile
 
diff --git a/src/Hakyll/Web/Preview/Server.hs b/src/Hakyll/Web/Preview/Server.hs
--- a/src/Hakyll/Web/Preview/Server.hs
+++ b/src/Hakyll/Web/Preview/Server.hs
@@ -13,7 +13,7 @@
 import System.Directory (doesFileExist)
 
 import qualified Data.ByteString as SB
-import Snap.Util.FileServe (serveFile)
+import Snap.Util.FileServe
 import Snap.Types (Snap, rqURI, getRequest, writeBS)
 import Snap.Http.Server ( httpServe, setAccessLog, setErrorLog, addListen
                         , ConfigListen (..), emptyConfig
@@ -21,41 +21,14 @@
 
 import Hakyll.Core.Util.String (replaceAll)
 
--- | The first file in the list that actually exists is returned
---
-findFile :: [FilePath] -> IO (Maybe FilePath)
-findFile [] = return Nothing
-findFile (x : xs) = do
-    exists <- doesFileExist x
-    if exists then return (Just x) else findFile xs
-
 -- | Serve a given directory
 --
 static :: FilePath             -- ^ Directory to serve
        -> (FilePath -> IO ())  -- ^ Pre-serve hook
        -> Snap ()
-static directory preServe = do
-    -- Obtain the path
-    uri <- rqURI <$> getRequest
-    let filePath = replaceAll "\\?.*$"  (const "")  -- Remove trailing ?
-                 $ replaceAll "#[^#]*$" (const "")  -- Remove #section
-                 $ replaceAll "^/"      (const "")  -- Remove leading /
-                 $ urlDecode $ decode $ SB.unpack uri
-
-    -- Try to find the requested file
-    r <- liftIO $ findFile $ map (directory </>) $
-        [ filePath
-        , filePath </> "index.htm"
-        , filePath </> "index.html"
-        ]
-
-    case r of
-        -- Not found, error
-        Nothing -> writeBS "Not found"
-        -- Found, serve
-        Just f  -> do
-            liftIO $ preServe f
-            serveFile f
+static directory preServe = serveDirectoryWith cfg directory
+  where
+    cfg = fancyDirectoryConfig {preServeHook = liftIO . preServe}
 
 -- | Main method, runs a static server in the given directory
 --
