Solo estoy desarrollando un sitio web con PHP y para el enrutamiento, decidí no construir todo el sistema yo mismo, luego elegí altorouter/altorouter. Así que aquí está mi árbol de sitios mi árbol de sitios
Y así es como se ve mi index.php
<?php define('WEBROOT', __DIR__); define('TARGET_PATH', WEBROOT.'/contents'); require 'vendor/autoload.php'; $router = new AltoRouter(); $router->setBasePath('/kpitalis.com/'); require_once 'config/routes.php'; $match = $router->match(); $target = $match['target']; $params = $match['params']; if (is_array($match)) { if (is_callable($match['target'])) { call_user_func_array($target, $params); } else { ob_start(); require TARGET_PATH."/{$target}.php"; $pageView = ob_get_clean(); } require TARGET_PATH."/frame/layout.php"; } else { require TARGET_PATH."/error.php"; } El archivo de mis rutas routes.php se ve así:
<?php $router->map('GET', '/', 'home', 'home'); $router->map('GET', '/contact', 'contact', 'contact'); $router->map('GET', '/about', 'about', 'about'); $router->map('GET', '/achievements', 'achievements', 'achievements'); $router->map('GET', '/achievements/[*:slug]', 'achievements', 'achievement'); $router->map('GET', '/projects', 'projects', 'projects'); $router->map('GET', '/projects/[*:slug]', 'projects', 'project'); $router->map('GET', '/news', 'news', 'news'); $router->map('GET', '/news/[*:slug]', 'news', 'single_news'); ?> Y mi .htaccess
Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]La cosa es que puedo obtener rutas cuando ejecuto el servidor PHP sel pero no puedo mis archivos css y javascipt (digo Ok, puedo arreglarlo más tarde) Ahora estoy tratando de ver cómo funciona en mi localhost pero todo Puedo llegar a la página de error error.php
¿Qué me estoy perdiendo?