Norgul
Norgul

Reputation: 4783

Laravel: routing not working

I have downloaded clients project from the internet, and it is programmed in Laravel (also seen by directory structure). I have set up homestead.yaml, hosts, filled the DB and modified .env. I also did a vagrant provision and 'composer dump-autoload` once everything was done.

Problem I'm facing is that home route '/' returns index.html in root. But route.php says different:

Route::get('/', 'PagesController@home');
Route::get('about', 'PagesController@about');

I've tried to intentionally modify routes so that they point to controller which doesn't exist, deleting some letters inside Kernel.php...anything that would reasonably produce an error, and nothing happens. I still get back what is inside index.html. Also there is index.php which gets returned after I enter anything after slash inside the url:

/bla

/nlo

/xyz

You get the point...what can be the issue?

I have also tried with artisan cache:clear

Upvotes: 1

Views: 1453

Answers (1)

Rápli András
Rápli András

Reputation: 3923

It's a webserver misconfiguration error. The webserver is configured to serve index.html with more priority than index.php. Relevant configuration can be found at /etc/apache2/httpd.conf, /etc/apache2/sites-available/your-site, .htaccess, or for nginx /etc/nginx/sites-available/your-site just to mention the two most common web servers.

Upvotes: 1

Related Questions