To run a Laravel project from the public folder without adding /public to the URL, you can follow these steps:
- Move all the files and folders from the public folder to the subfolder on the subdomain (public_html/subdomain/subfolder).
- Edit the index.php file in the subfolder on the subdomain and change the following line:
require __DIR__.'/../bootstrap/autoload.php';
to:
require __DIR__.'/../../bootstrap/autoload.php';
- Also, change the following line:
$app = require_once __DIR__.'/../bootstrap/app.php';
to:
$app = require_once __DIR__.'/../../bootstrap/app.php';
- Save the changes and try accessing the website without adding /public to the URL.
Note: This solution assumes that the Laravel project is installed in the root directory of the subfolder on the subdomain. If it is installed in a subdirectory, you will need to adjust the paths accordingly.