namespace AutoblogPro\Router;
use Pecee\Http\Request;
use Pecee\SimpleRouter\SimpleRouter;
use Pecee\SimpleRouter\Exceptions\NotFoundHttpException;
class Routes
{
public function __construct()
{
SimpleRouter::setDefaultNamespace('AutoblogPro\Controllers');
// Add route to handle static PHP files under /post/
SimpleRouter::get('/post/{filename}', function($filename) {
$filePath = __DIR__ . "/../post/$filename.php"; // Adjust the path according to your directory structure
if (file_exists($filePath)) {
include $filePath;
exit();
}
// If file does not exist, proceed with the dynamic route
SimpleRouter::response()->redirect('/404');
});
// Other routes
SimpleRouter::get('about', 'Pages@about');
SimpleRouter::get('contact', 'Pages@contact');
SimpleRouter::get('term-of-service', 'Pages@tos');
SimpleRouter::get('privacy-policy', 'Pages@privacyPolicy');
SimpleRouter::get('disclaimer', 'Pages@disclaimer');
SimpleRouter::get('dmca', 'Pages@dmca');
SimpleRouter::get('404', 'Pages@notFound');
SimpleRouter::get('sitemap.xml', 'Sitemaps@keywords');
SimpleRouter::get('images.xml', 'Sitemaps@images');
SimpleRouter::get('feed', 'Sitemaps@feed');
SimpleRouter::get('hapus-session', 'Cleaner@session');
SimpleRouter::get('hapus-cache', 'Cleaner@cache');
SimpleRouter::get('hapus-cookies', 'Cleaner@cookies');
SimpleRouter::get('download-pdf', 'Documents@PDF');
SimpleRouter::get('/', 'Contents@index');
SimpleRouter::get('random', 'Contents@random');
SimpleRouter::get('search', 'Contents@search');
SimpleRouter::get('{uri}', 'Contents@detail', ['defaultParameterRegex' => '(.)*']);
SimpleRouter::error(function(Request $request, \Exception $exception) {
if($exception instanceof NotFoundHttpException && $exception->getCode() === 404) {
header('location: /404');
}
});
SimpleRouter::start();
}
}
namespace AutoblogPro\Router;
use Pecee\Http\Request;
use Pecee\SimpleRouter\SimpleRouter;
use Pecee\SimpleRouter\Exceptions\NotFoundHttpException;
class Routes
{
public function __construct()
{
SimpleRouter::setDefaultNamespace('AutoblogPro\Controllers');
// Add route to handle static PHP files under /post/
SimpleRouter::get('/post/{filename}', function($filename) {
$filePath = __DIR__ . "/../post/$filename.php"; // Adjust the path according to your directory structure
if (file_exists($filePath)) {
include $filePath;
exit();
}
// If file does not exist, proceed with the dynamic route
SimpleRouter::response()->redirect('/404');
});
// Other routes
SimpleRouter::get('about', 'Pages@about');
SimpleRouter::get('contact', 'Pages@contact');
SimpleRouter::get('term-of-service', 'Pages@tos');
SimpleRouter::get('privacy-policy', 'Pages@privacyPolicy');
SimpleRouter::get('disclaimer', 'Pages@disclaimer');
SimpleRouter::get('dmca', 'Pages@dmca');
SimpleRouter::get('404', 'Pages@notFound');
SimpleRouter::get('sitemap.xml', 'Sitemaps@keywords');
SimpleRouter::get('images.xml', 'Sitemaps@images');
SimpleRouter::get('feed', 'Sitemaps@feed');
SimpleRouter::get('hapus-session', 'Cleaner@session');
SimpleRouter::get('hapus-cache', 'Cleaner@cache');
SimpleRouter::get('hapus-cookies', 'Cleaner@cookies');
SimpleRouter::get('download-pdf', 'Documents@PDF');
SimpleRouter::get('/', 'Contents@index');
SimpleRouter::get('random', 'Contents@random');
SimpleRouter::get('search', 'Contents@search');
SimpleRouter::get('{uri}', 'Contents@detail', ['defaultParameterRegex' => '(.)*']);
SimpleRouter::error(function(Request $request, \Exception $exception) {
if($exception instanceof NotFoundHttpException && $exception->getCode() === 404) {
header('location: /404');
}
});
SimpleRouter::start();
}
}
Fatal error: Uncaught Error: Class 'AutoblogPro\Router\Routes' not found in /home/vrogue.co/public_html/index.php:29
Stack trace:
#0 {main}
thrown in /home/vrogue.co/public_html/index.php on line 29