Answer the question
In order to leave comments, you need to log in
How to fix 404 Not Found error in Laravel under Ubuntu 20.04?
I started making an application on Laravel, put it in /var/www/app.test, added a new route to api.php
:
<?php
use App\Listing;
use Illuminate\Support\Facades\Route;
Route::get('listing/{listing}', function (Listing $listing) {
return $listing->toJson();
});
/etc/apache2/apache.conf
added the following lines:<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName app.test
ServerAlias www.app.test
DocumentRoot /var/www/app.test
ErrorLog ${APACHE_LOG_DIR}/app_error.log
CustomLog ${APACHE_LOG_DIR}/app_access.log combined
</VirtualHost>
<Directory /var/www/app.test>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
/etc/apache2/sites-available/000-default.conf
looks like this:<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html
<Directory /var/www/html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
mod_rewrite
included. But after the above changes and restarting apache, the error did not go away. How to fix it?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question