steampixel / simplePHPRouter

This is a simple and small single class PHP router that can handel the whole url routing for your project.
MIT License
406 stars 117 forks source link

everything redirects to 404 #53

Closed linkin85 closed 2 years ago

linkin85 commented 2 years ago

Hey buddy, firstly thank you for this script, it's amazingly fast and compact ♥️ I'm getting all routes returning a generic 404. I have used this script before and was working fine, however since upgrading to php 8, the mentioned problem started.

I can confirm that index.php is in the main folder and src folder are exactly where they should be. i can also confirm that .htaccess file is exactly as described. i can confirm that simply running this:

$routes = Route::getAll();
foreach($routes as $route) {
  echo $route['expression'].' ('.$route['method'].')';
}

print out all the routes.

but trying domain/route, returns generic 404.

any idea? p.s. im on Apache/2.4.38 (Debian) PHP 8.0.13 with mod_rewrite enabled.

Many thanks indeed.

linkin85 commented 2 years ago

nevermind, it was my apache configuration file, AllowOverride None changed to AllowOverride All

steampixel commented 2 years ago

Hey @linkin85 I will mention the AllowOverride All directive in the readme. Thanks