Pagi @davy_yg,
When you deploy your site you are meant to point the domain to the public folder. Not the root of the project.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
I tried to remove public from the url and found this link:
Only that it is in Indonesian. I try to translate Option 2 to English perhaps if it makes any sense? (I understand the rest of it besides this one):
Option 2: Move something to the directory '/public' to the root directory
Create a folder in the root directory and move ll the files and folder expect for the public folder. You can call it anything you want. In this case, I use "laravel code".
Next, move everything from the public directory and to the root folder. It will result something like this:
I finally found the answer by using .htaccess, someone advice to do so:
.htaccess
<IfModule mod_rewrite.c>
#Session timeout
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^ [N]
RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
RewriteRule ^(.*)$ public/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ server.php
</IfModule>
Please or to participate in this conversation.