charlesBR
1091
22
Laravel

Removing "/public" from URL (Where does Laravel get the base URL from?)

Posted 3 years ago by charlesBR

I'm deploying a new app today. It works great on my local machine with Homestead but not on production server. The problem is with the url() function. It's appending a /public after every generated URLs. Check it out: http://apps.mppr.mp.br/concurso_estagiario/

See? The links and assets are broken due to that additional /public.

How can I remove it?

PS: I'm not able to change the DocumentRoot on the server, because there are multiple applications on this virtual host. Neither could I solve it using alias. I'm not allowed to use .htaccess files either due to internal politics, but I have broad access to make changes to the virtual hosts file.

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.