Laravel 5 public folder


Hi all,

i have a problem about the path of my laravel app.
What i need is to remove in URL the ‘public’ folder …

I read the cloud9 documentation where explain to do that:

Step 1:
sudo nano /etc/apache2/sites-enabled/001-cloud9.conf

Step 2:
// Change this line
DocumentRoot /home/ubuntu/workspace

// To following
DocumentRoot /home/ubuntu/workspace/public

I did that, the file is edited but still i’ve the same problem …



if someone else has the same problem just read this topic:

1 Like

To remove public from the URL of your Laravel website, you have to edit .htaccess file and add rewrite rules in it. Add this to your htaccess file:

RewriteEngine on
# serve existing files in the /public folder as if they were in /
RewriteCond %{DOCUMENT_ROOT}public%{REQUEST_URI} -f
RewriteRule (.+) /public/$1 [L]
# route everything else to /public/index.php
RewriteRule ^ /public/index.php [L]

source: Laravel htaccess