Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kikloo's avatar

Laravel not working and showing 404 Not Found

HI,

I have uploaded Laravel on my DirectAdmin hosting and in a sub folder. When I'm going to mysite.com/demosite its not working and showing 404 Not Found but when I goto mysite.com/demosite/public then its working.

On my local it works fine, but on server its not working as local.

How to fix ?

Thanks

0 likes
9 replies
kikloo's avatar

Hi,

Thanks for the answer but that is not going to work for me. My admin will not do that for me. I need some htacess based solution.

Can anyone help ?

Thanks.

1 like
jlrdw's avatar

@kikloo Also read the deployment chapter in the documentation. You probably have your .env exposed if laravel isn't setup correctly, meaning the proper folder structure.

Just FYI, setting up correctly on shared hosting has been discussed many times here on this forum.

1 like
kikloo's avatar

I’m sorry but I’m still not able to fix the issue. Despite reading a lot of posts and other stuff I’m not able to make public folder as document root. No matter what I put in htaccess file I still get 404 - NOT FOUND by laravel.

This is now becoming a big blocker. How to go about it ? Why it’s like that ?

1 like
vincent15000's avatar

@kikloo Are you sure ? It's strange, I also have several shared webhosting and on all ones I can point the domain to the public folder.

kikloo's avatar

Some local chaps hosting.

1 like
jlrdw's avatar

@kikloo search for a post by @tray2, he had an htaccess to correctly set this up. I don't have the link.

1 like

Please or to participate in this conversation.