Skip to content

Commit

Permalink
Fix issue with rewrite script not serving up home page.
Browse files Browse the repository at this point in the history
  • Loading branch information
lonnieezell committed Nov 14, 2016
1 parent 867965a commit c24b358
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rewrite.php
Expand Up @@ -10,11 +10,11 @@

$uri = urldecode(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));

$path = __DIR__.'public/'.$uri;
$path = __DIR__.'public/'.ltrim($uri,'/');

// If $path is an existing file or folder within the public folder
// then let the request handle it like normal.
if (is_file($path) || is_dir($path))
if ($uri !== '/' && (is_file($path) || is_dir($path)))
{
return false;
}
Expand Down

0 comments on commit c24b358

Please sign in to comment.