diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,3 +1,7 @@
+## 1.4.18.2
+
+* Allow subsites within hierarchical routes [#1144](https://github.com/yesodweb/yesod/pull/1144)
+
 ## 1.4.18
 
 * Add hook to apply arbitrary function to all handlers [#1122](https://github.com/yesodweb/yesod/pull/1122)
diff --git a/Yesod/Core/Handler.hs b/Yesod/Core/Handler.hs
--- a/Yesod/Core/Handler.hs
+++ b/Yesod/Core/Handler.hs
@@ -580,7 +580,7 @@
 
 -- | Bypass remaining handler code and output the given JSON with the given
 -- status code.
-sendStatusJSON :: (MonadHandler m, ToJSON a) => H.Status -> a -> m a
+sendStatusJSON :: (MonadHandler m, ToJSON c) => H.Status -> c -> m a
 sendStatusJSON s v = sendResponseStatus s (toJSON v)
 
 -- | Send a 201 "Created" response with the given route as the Location
diff --git a/Yesod/Routes/TH/Dispatch.hs b/Yesod/Routes/TH/Dispatch.hs
--- a/Yesod/Routes/TH/Dispatch.hs
+++ b/Yesod/Routes/TH/Dispatch.hs
@@ -176,11 +176,12 @@
                     subDispatcherE <- mdsSubDispatcher
                     runHandlerE <- mdsRunHandler
                     sub <- newName "sub"
+                    sroute <- newName "sroute"
                     let sub2 = LamE [VarP sub]
                             (foldl' (\a b -> a `AppE` b) (VarE (mkName getSub) `AppE` VarE sub) dyns)
                     let reqExp' = setPathInfoE `AppE` VarE restPath `AppE` reqExp
                         route' = foldl' AppE (ConE (mkName name)) dyns
-                        route = foldr AppE route' extraCons
+                        route = LamE [VarP sroute] $ foldr AppE (AppE route' $ VarE sroute) extraCons
                         exp = subDispatcherE
                             `AppE` runHandlerE
                             `AppE` sub2
diff --git a/test/YesodCoreTest/WaiSubsite.hs b/test/YesodCoreTest/WaiSubsite.hs
--- a/test/YesodCoreTest/WaiSubsite.hs
+++ b/test/YesodCoreTest/WaiSubsite.hs
@@ -15,6 +15,8 @@
 mkYesod "Y" [parseRoutes|
 / RootR GET
 /sub WaiSubsiteR WaiSubsite getApp
+/nested NestedR:
+  /sub NestedWaiSubsiteR WaiSubsite getApp
 |]
 
 instance Yesod Y
@@ -34,5 +36,10 @@
 
     it "subsite" $ app $ do
       res <- request defaultRequest { pathInfo = ["sub", "foo"] }
+      assertStatus 200 res
+      assertBodyContains "WAI" res
+
+    it "nested subsite" $ app $ do
+      res <- request defaultRequest { pathInfo = ["nested", "sub", "foo"] }
       assertStatus 200 res
       assertBodyContains "WAI" res
diff --git a/yesod-core.cabal b/yesod-core.cabal
--- a/yesod-core.cabal
+++ b/yesod-core.cabal
@@ -1,5 +1,5 @@
 name:            yesod-core
-version:         1.4.18.1
+version:         1.4.18.2
 license:         MIT
 license-file:    LICENSE
 author:          Michael Snoyman <michael@snoyman.com>
