Protecting Laravel Root Directory

I'm having a problem with denying access to the root directory of my Laravel Site...

I have my project in xampp/htdocs/laravel

Of course Laravel routes the /public directory...

But how can I deny access to the directory xampp/htdocs/laravel ...? How can I prevent the directory listing?

The only way I've found is putting an index.php with a header("location: /laravel/public")

But I dont know if it's the best way... should I use .htaccess? How? I've tried a few but it results in major errors across the server.



Read more here: https://stackoverflow.com/questions/21339995/protecting-laravel-root-directory

Content Attribution

This content was originally published by Gabriel Matusevich at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: