How to fix the /public on a shared host

TestingThis

New member
Joined
Dec 10, 2025
Messages
8
Hey therem

I just bought a webhosting thing on a host and its probably a shared host. But when i wanna host my laravel stuff on it it having a /public folder after the domain how can I fix this?
 
If it's shared hosting and you've only bought an account, you'll have to approach your host to see if Laravel is available for their setup. This forum is for Sysadmins only.
 
Yes they have laravel avaibable as I got a laravel website running, but it says folder (public/) is there a way I can fix that that thats gone or does the host need to do that (and how will it mess something else up if they fix it for laravel or else?)
 
I'm sorry but you're being very vague here. "but it says folder (public/) " really doesn't help at all. Try telling us what you're trying to do, what folder you're trying to use, what folder it's telling you to use and we can start from there.

Just for clarification, a directadmin site has the folder path /domains/yourdomain.com/public_html/ and anything in this folder is served to a web browser. So if you wanted your homepage/project to appear when you type in www.domain.com, put the contents in that folder.

If you wanted the contents to be viewed at www.domain.com/public/ you need to create the folder /domains/yourdomain.com/public_html/public/ and put the files in there.
 
hey there, my bad.

I have created a domain subdomain.domain.com I upload it to public_html all my files and then when i got to my subdomain.domain.com it sends me to subdomain.domain.com/public

But this is bad and I dont want that as now alot of navigations doesnt work and all sort of stuff (and its ugly asf)
 
If you create a subdomain, make a note of the option you select. It will show you where the root directory for web files go.

1765363371516.png
 
its in the subdomain right now, for development. its on default so that means everything needs to go in public_html (where all files are) I installed laravel with the "Softaculous Apps Installer" and just transfered all files to the laravel files where the Installer put them
 
and now when I go the the site it says subdomain.domain.com/public even tho its just laravel folders and on my localhost it just 127.0.0.1/page instead of domain.com/public/page
 
How to do that? and how will that fix the issue as then it will still show domain/public/page

instead of just domain/page
 
I have this terminal (but I dont think you mean that) The ssh/terminal in where the directadmin is hosted on no I dont own the whole server Its just a shared hosting.
1765366916970.png
 
Good. What you need to do it to (replace domain.com to real domain name):
- Move your /public folder to be in domains/domain.com/public (you can use File Manager or FTP for this)
- Click Terminal
- Execute these commands:
Code:
cd domains/domain.com
mv public_html public_html_old
ln -sf public public_html

This is it, it will create a symlink (shortcut) from public_html to public folder, thus your domain.com will just point to public (laravel) :)
 
Back
Top