diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5b6cc6e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/public/.htaccess + diff --git a/bootstrap.php b/bootstrap.php index 275bb91..6e8573d 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -53,7 +53,9 @@ /** * Setup routing */ -switch(trim($_SERVER['REQUEST_URI'], '/')) { + +$request = explode('/', $_SERVER['REQUEST_URI']); +switch(end($request)) { case 'configuration': ob_start(); require __DIR__ . '/template/configuration.phtml'; diff --git a/public/.htaccess.dist b/public/.htaccess.dist new file mode 100644 index 0000000..7a6bc6d --- /dev/null +++ b/public/.htaccess.dist @@ -0,0 +1,6 @@ +RewriteEngine on +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteCond %{REQUEST_URI} !=favicon.ico +RewriteRule ^ /index.php [L] + diff --git a/public/js/main.js b/public/js/main.js index 2edb478..eee061e 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -108,7 +108,7 @@ if ($(td).hasClass('active')) { $(td).removeClass('active'); - td.querySelector('img').src = '/style/toggle-expand.png'; + td.querySelector('img').src = 'style/toggle-expand.png'; td.querySelector('img').setAttribute('alt', '+'); var rows = document.querySelectorAll('.script'); for (var i = 0, l = rows.length; i < l; i++) { @@ -120,7 +120,7 @@ } } else { $(td).addClass('active'); - td.querySelector('img').src = '/style/toggle-collapse.png'; + td.querySelector('img').src = 'style/toggle-collapse.png'; td.querySelector('img').setAttribute('alt', '-'); var rows = document.querySelectorAll('.script'); for (var i = 0, l = rows.length; i < l; i++) { diff --git a/template/cached.phtml b/template/cached.phtml index 70e33ba..6c9501f 100644 --- a/template/cached.phtml +++ b/template/cached.phtml @@ -20,7 +20,7 @@ foreach($status->getCachedScripts() as $data) { $scripts) { ?>
= $directory . sprintf($translator->translate('scripts.directory.script_count'), count($scripts)); ?>
= $directory . sprintf($translator->translate('scripts.directory.script_count'), count($scripts)); ?>