0

I just started learning Laravel and I'm not too excited about it. Getting rid of the "public" folder and accessing your website directly is not an easy task.

The easiest solution I found here is to move public folder contents outside and then edit the index.php file - shared hosting. But it's not pretty.

Does it pose any risk? Because according to the design those files supposed to be accessed from within the public folder.

halfer
  • 19,824
  • 17
  • 99
  • 186
Marina Dunst
  • 859
  • 1
  • 6
  • 19
  • You shouldn't have to get rid of your public folder at all.. What are you trying to accomplish? –  Mar 04 '15 at 18:42
  • There is more than one solution to deploying Laravel applications to a shared server and unless you really need to, there's no reason remove the public folder. Here's an article explaining additional methods http://driesvints.com/blog/laravel-4-on-a-shared-host. – Bogdan Mar 04 '15 at 18:50
  • I had a similar problem as the asker of this question and I followed answerer's advice [original question](http://stackoverflow.com/questions/28662657/laravel-url-without-public-folder) – Marina Dunst Mar 04 '15 at 19:23
  • I just dont understand why one has to use tricks, hacks and follow long tutorials just to be able to access your website without /public folder. Its easy in other frameworks. – Marina Dunst Mar 04 '15 at 19:24
  • 2
    If you're putting this on a server, then the public folder is where all your css, js, and images should be stored. You would just write an alias in the apache config, or use a .htaccess in the root with the alias pointing to the public directory. There's no need for removing it, and this is how I do it on my server. – Pazuzu156 Mar 06 '15 at 05:26
  • Marina, do you mean you want to remove the 'public' from the URL of your website? (i.e. not remove the filesystem folder necessarily) So you have www.site.com/public/index.php you just want www.site.com/index.php. But because you are on shared hosting installing Laravel in the web root, by default adds this path to the URL. Kaleb is right, (normally you would root a Laravel site into the public folder in the VirtualHost so it won't be in the URL) so you need to adjust the apache configuration to use the public folder as the website root. – scipilot Apr 06 '15 at 06:28

0 Answers0