Point your DocumentRoot to the correct folder. You are likely pointing to 1, that's why you have a public in your URL. You need to point it to #2 instead
└── app <- 1. Laravel root folder, DocumentRoot CANNOT point here
├── public <- 2. DocumentRoot MUST point here, i.e. https://yourdomain.com
│ └── robots.txt <- 3. MUST be able to load https://yourdomain.com/robots.txt
├── storage
...
└── vendor
hi thanks for your answers, the problem is that my host is a shared host and I don't have permissions for the htdocs folder, and the domain hosts different pojects for example
├── public_html <- 1. DocumentRoot MUST point here
│ └── blog <- 3. move and rename `public` as `blog`, https://yourdomain.com/blog
│ ├── robots.txt <- 4. MUST be able to load https://yourdomain.com/blog/robots.txt
│ └── index.php <- 5. Must modify this index.php
└── blogapp <- 2. Laravel root folder, DocumentRoot CANNOT point here
├── storage
...
└── vendor
// find an change these 2 lines in public_html/blog/index.php
...
// require __DIR__.'/../vendor/autoload.php';
require __DIR__.'/../../blogapp/bootstrap/autoload.php';
...
// $app = require_once __DIR__.'/../bootstrap/app.php';
$app = require_once __DIR__.'/../../blogapp/bootstrap/app.php';
...
Yet it's so clear-cut if you follow it step-by-step. Another problem is they go for cheap shared hosting sometimes where you cannot move main laravel out of Webroot on some hosts.
Also the same technique has been done on a YouTube video, where a simple search would reveal it.
Surely anyone should know by now, and as long as laravel has been around there has got to be YouTube videos on laravel.
But making sure .env is not exposed is definitely better than nothing.