Skip to content

Commit 434cd3e

Browse files
authored
Merge pull request #40 from redelschaap/patch-1
Adds support for manually added folders in the URL Key of a post. This allows post URLs like http://www.domain.com/blog/category-title/post-title/
2 parents e4f6cd2 + 555d8a1 commit 434cd3e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Controller/Router.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ public function match(\Magento\Framework\App\RequestInterface $request)
179179
$pathInfo[2] = $pathInfo[1];
180180
$pathInfo[1] = Url::CONTROLLER_CATEGORY;
181181
}
182+
} elseif (count($pathInfo) > 1) {
183+
if ($postId = $this->_getPostId(implode('/', $pathInfo))) {
184+
$pathInfo[2] = implode('/', $pathInfo);
185+
$pathInfo[1] = Url::CONTROLLER_POST;
186+
}
182187
}
183188
}
184189
break;

0 commit comments

Comments
 (0)