Skip to content

Commit

Permalink
Fix for subfolder install [#2964]
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed Dec 15, 2020
1 parent 26f4d05 commit 307ede3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions system/src/Grav/Common/Processors/InitializeProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,10 @@ protected function handleRedirectRequest(RequestInterface $request): ?ResponseIn
{
// Redirect pages with trailing slash if configured to do so.
$uri = $request->getUri();
$path = $request->getUri()->getPath() ?: '/';
$path = $uri->getPath() ?: '/';
$root = $this->container['uri']->rootUrl();

if ($path !== '/' && Utils::endsWith($path, '/')
) {
if ($path !== $root && $path !== $root . '/' && Utils::endsWith($path, '/')) {
return $this->container->getRedirectResponse((string)$uri->withPath(rtrim($path, '/')));
}

Expand Down

0 comments on commit 307ede3

Please sign in to comment.