1. Uploaded my files to 000webhost. I placed all files from the public folder to public_html then I created a folder named laravel and there I uploaded all other files. This is the structure of my directory:
laravel
app
bootstrap
config
....
public_html
index.html
.....
2. In my index.php file, I already changed some things to these
require DIR.'/../laravel/bootstrap/autoload.php';
$app = require_once DIR.'/../laravel/bootstrap/app.php';
3. I also changed the .env file and the database.php in the laravel/config folder
Problem:
I am now able to access the home page of my site, but when I click my links to the other pages error 404 shows up.
How do I fix this?
And how do I access the routes in my api.php ?
Thanks!
Your includes seem fine.
Be sure you also uploaded the .htaccess file located in /public (in your /public_html). The file name starts with a dot so it's commonly hidden. The purpose of this file is to indicate Apache how to map URLs to real files (in this case, everything should point to index.php)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With