Hostinger Shared Hosting subdomain for admin panel
Hello everyone, nice to meet you! Would really appreciate your help if you have the time!
I've chosen Hostinger's Shared Hosting Plan for my project. I've successfully setup the "front-end" with Jetstream on the main domain.
What I'm trying to do:
Use a subdomain exclusively for filament without the need of creating a new project inside the subdomain's directory.
It's worth noting that everything lives within the same app.
What I did: I've set up the subdomain as an env variable that I've configured within the production env. Not sure is this is the correct way to work in production because it works as expected locally. ✅ I've implemented the UserContract in the User model The error: 403 forbidden Below is a snippet of the project's root .htaccess that i've attempted with no luck
What I did: I've set up the subdomain as an env variable that I've configured within the production env. Not sure is this is the correct way to work in production because it works as expected locally. ✅ I've implemented the UserContract in the User model The error: 403 forbidden Below is a snippet of the project's root .htaccess that i've attempted with no luck
Solution:Jump to solution
Wow I feel like an idiot. It wasn’t pointing to the project’s public folder. Filament is up & running now on subdomain as expected.
Thank you both so much. And sorry for the trouble.
P.d. I will probably be asking more help along the way 😅...
11 Replies
1. Shared Hosting is never recommended for Laravel
2. Never use
env()
inside your project. It must only be used in config files.
Is the 403 coming from Laravel or Apache? Can't tell much about your Apache config.1. Got it! The reason behind it was for economic reasons
2. Noted! Thank you!
Sorry about that. 403 coming from Apache. I believe it’s for the same reasons I had it on initial deploy before adding the .htaccess in root. The only major change for apache config was adding the project root .htaccess on deploy.
This is all I had for the initial deployment that is running correctly.
Not trying to blow up your notifications or bother you, just making sure you know I answered. Thanks for replying btw!
You can use a digital ocean droplet or even Aws for less than $5 a month. Shared hosting. As far as I’m concerned is never an option.
Yup! Digitalocean is also juicy. For this and other reasons, client decided to go with hostinger. Sorry, the last part of “is never an option”, what are you referring to?
Thanks in advance.
It’s just a hassle to set up. Most of them don’t even allow to set the DomainRoot.
Is the subdomain at all working? Did you try with a simple html file or similar? The subdomain is also pointing to the public folder?
After some research, I found that there’s a specific line in Digitalocean droplets where it is still shared hosting. You have to have specific specs for it to be private and it is a bit of $.
1. Subdomain working correctly
2. Would I have to symlink it to public folder?
No symlink. It should just point to the public folder as the main domain should
Oh ok! So to the public_html where my app is or you mean the public folder of my app?
Solution
Wow I feel like an idiot. It wasn’t pointing to the project’s public folder. Filament is up & running now on subdomain as expected.
Thank you both so much. And sorry for the trouble.
P.d. I will probably be asking more help along the way 😅
Always the public folder. Anything else is not secure
Thanks again!