I have a Laravel + Filament environment running locally and I had setup some Github actions to deploy on a shared hosting, depending on the pushed branch (branch develop -> develop public_html/develop directory and branch staging -> public_html/staging directory).
I setup the database and .env file.
When I push to develop, the Action clones the repo at develop branch and runs composer install and the migrations, but it is not working:
- If I go to /develop it raises 403
- If I go to /develop/public it shows the default laravel page
- If I go to /develop/public/admin it shows the default Filament login form (and it is correct!), but when I enter the user and password the page does not change (only refreshes)
I do not know how to setup the htaccess files neither where to put the files properly.
Can you help me?
2
Answers
Just try following answer.
How do you redirect all request to public/ folder in laravel 5
This is what I did:
COPY htaccess file from the public folder to the root folder (keep the original file in public only) and add two extra lines to the htaccess file in the root folder.
Root folder htaccess file looks like this.
Hope this answer will help!
If you are using GitHub for deploying on cPanel especially when ssh and terminal is enabled then follow this guide: