I would recommend finding a better hosting provider which doesn't require all content to be publicly available.
Jul 13, 2015
5
Level 1
Moving Laravel core in a subfolder of public
Hi all, I'm new :-)
With a hosting provider that I have to use for a project all web content is publicly available. So I moved the core contents in a subfolder (called "laravel") in this way:
- Moved everything in laravel folder
- Moved laravel/public/* in / (document root)
- Updated index.php lines
require __DIR__.'/laravel/bootstrap/autoload.php';
$app = require_once __DIR__.'/laravel/bootstrap/app.php';
- Created a laravel/.htaccess
<IfModule mod_rewrite.c>
RewriteRule ^(.*)$ /httpdoc/$1 [L,R=301]
</IfModule>
All seems to work correctly... but I have little experience with Laravel.
- Do I have to modify something else?
- Do you see drawbacks with this method?
Level 1
Mmm... no, it's not so simple. If I remove "public" using mod_rewrite I get routing errors. I suppose that my current solution is the best one for now.
Please or to participate in this conversation.