This should work
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hey, so I'm using Laravel on shared hosting for a customer I have, however everytime I visit my main URL it redirects me to /public/
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/ [L]
</IfModule>
I'm fairly certain the htaccess is not the issue, but I feel like I've tried everything.
I am unable to change my document root to public, which is also why I'm posting now, because I've seen that people suggest it, however not at option for me.
Please or to participate in this conversation.