i write simple route for my script . and it works well but my index.php loads under all of pages .
.htaccess file :
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
RewriteRule ^(.+)/$ /$1 [R,L]
RewriteCond %{REQUEST_URI} !.(css|woff|woff2|svg|eot|ttf|jpe?g|gif|png|js|ico)$ [NC]
route.php :
$request = $_SERVER['REQUEST_URI'];
switch ($request) {
case '/' :
require __DIR__ . '/index.php';
break;
case '/item/' :
require __DIR__ . '/template/item.php';
break;
}