.htaccess on root directory to redirect to public folder

Posted 1 year ago by dohisev

As I'm in a shared hosting and I can't create a apache virtual host to point to the public folder I tried to use the solution of creating a .htaccess on the root folder to point to the public but it doesn't work, I'm getting an error: Sorry, the page you are looking for could not be found.:

<IfModule mod_rewrite.c>
   RewriteEngine On 
   RewriteRule ^(.*)$ public/ [L]

How can I solve this? I also trying to get all the files from the public to the root folder but the css and js files are not loading properly using mix.

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


Reply to

Use Markdown with GitHub-flavored code blocks.