laracasts / The-PHP-Practitioner-Episode-16

70 stars 28 forks source link

404 on link clicking #1

Open leanderr opened 6 years ago

leanderr commented 6 years ago

Using Windows and Xamp cloning repo I can only access the Index. Clicking the links will 404.

Miodrag09 commented 6 years ago

Sorry if this looks like a noob issue, I downloaded your code from https://github.com/laracasts/The-PHP-Practitioner-Episode-16, and I'm getting this error: "Fatal error: Uncaught exception 'Exception' with message 'No route defined for this URI.' in C:\wamp64\www\The-PHP-Practitioner-Episode-16-master\core\Router.php on line 27" "Exception: No route defined for this URI. in C:\wamp64\www\The-PHP-Practitioner-Episode-16-master\core\Router.php on line 27"

fabianlugones commented 5 years ago

Using Windows and Xamp cloning repo I can only access the Index. Clicking the links will 404.

That's because you didn't modify your .htaccess file. If you don't have one, create a file called '.htaccess' and fill it with the following content:

RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+)$ index.php [QSA,L]

More information on this link : https://www.taniarascia.com/the-simplest-php-router/