Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel/00webhost Error 404. The requested URL was not found on this server

Tags:

php

laravel

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!

like image 992
Mary Nicole Aplita Avatar asked Nov 27 '25 22:11

Mary Nicole Aplita


1 Answers

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)

like image 151
Didier Sampaolo Avatar answered Nov 30 '25 11:11

Didier Sampaolo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!