diff --git a/Hack/Middleware/CleanPath.hs b/Hack/Middleware/CleanPath.hs
--- a/Hack/Middleware/CleanPath.hs
+++ b/Hack/Middleware/CleanPath.hs
@@ -10,7 +10,14 @@
 cleanPath :: Middleware
 cleanPath app env =
     case splitPath $ pathInfo env of
-        Left p -> return $! Response 303 [("Location", p)] BS.empty
+        Left p -> do
+            -- include the query string if there
+            let suffix =
+                    case queryString env of
+                        "" -> ""
+                        q@('?':_) -> q
+                        q -> '?' : q
+            return $! Response 303 [("Location", p ++ suffix)] BS.empty
         Right _ -> app env
 
 -- | Given a certain requested path, return either a corrected path
diff --git a/hack-middleware-cleanpath.cabal b/hack-middleware-cleanpath.cabal
--- a/hack-middleware-cleanpath.cabal
+++ b/hack-middleware-cleanpath.cabal
@@ -1,5 +1,5 @@
 name:            hack-middleware-cleanpath
-version:         0.0.0
+version:         0.0.1
 license:         BSD3
 license-file:    LICENSE
 author:          Michael Snoyman <michael@snoyman.com>
@@ -15,7 +15,7 @@
 homepage:        http://github.com/snoyberg/hack-middleware-cleanpath/tree/master
 
 library
-    build-depends:   base >= 3, split >= 0.1.1, web-encodings,
+    build-depends:   base >= 3 && < 5, split >= 0.1.1, web-encodings,
                      bytestring >= 0.9.1.4, hack >= 2009.5.19
     exposed-modules: Hack.Middleware.CleanPath
     ghc-options:     -Wall
