diff --git a/Network/Wai/Middleware/CleanPath.hs b/Network/Wai/Middleware/CleanPath.hs
--- a/Network/Wai/Middleware/CleanPath.hs
+++ b/Network/Wai/Middleware/CleanPath.hs
@@ -1,24 +1,28 @@
-module Network.Wai.Middleware.CleanPath (cleanPath, splitPath) where
+module Network.Wai.Middleware.CleanPath (cleanPath, cleanPathRel, splitPath) where
 
 import Network.Wai
 import qualified Data.ByteString.Char8 as B
 import Network.URI (unEscapeString)
 
 -- | Performs redirects as per 'splitPath'.
-cleanPath :: ([String] -> Request -> IO Response)
-          -> Request
-          -> IO Response
-cleanPath app env =
+cleanPathRel :: B.ByteString -> ([String] -> Request -> IO Response) -> Request -> IO Response
+cleanPathRel prefix app env =
     case splitPath $ pathInfo env of
-        Left p -> do
-            -- include the query string if present
-            let suffix = case B.uncons $ queryString env of
-                            Nothing -> B.empty
-                            Just ('?', _) -> queryString env
-                            _ -> B.cons '?' $ queryString env
-            return $ Response Status303 [(Location, B.append p suffix)]
-                   $ Right emptyEnum
         Right pieces -> app pieces env
+        Left p -> return
+                . Response Status301
+                  [(Location, B.concat [prefix, p, suffix])]
+                $ Right emptyEnum
+    where
+        -- include the query string if present
+        suffix =
+            case B.uncons $ queryString env of
+                Nothing -> B.empty
+                Just ('?', _) -> queryString env
+                _ -> B.cons '?' $ queryString env
+
+cleanPath :: ([String] -> Request -> IO Response) -> Request -> IO Response
+cleanPath = cleanPathRel B.empty
 
 emptyEnum :: Enumerator
 emptyEnum = Enumerator $ \_ -> return . Right
diff --git a/wai-extra.cabal b/wai-extra.cabal
--- a/wai-extra.cabal
+++ b/wai-extra.cabal
@@ -1,5 +1,5 @@
 Name:                wai-extra
-Version:             0.1.2.1
+Version:             0.1.3
 Synopsis:            Provides some basic WAI handlers and middleware.
 Description:         The goal here is to provide common features without many dependencies.
 License:             BSD3
