Last active
December 16, 2015 10:19
-
-
Save jlopezcur/fd13e83113676bce0f67 to your computer and use it in GitHub Desktop.
Laravel 5 on subdir (moving public content to project root)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# File: /.htaccess (After move public content to root) | |
<IfModule mod_rewrite.c> | |
<IfModule mod_negotiation.c> | |
Options -MultiViews | |
</IfModule> | |
RewriteEngine On | |
# Redirect Trailing Slashes If Not A Folder... | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)/$ /subfolder/$1 [L,R=301] | |
# Handle Front Controller... | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^ index.php [L] | |
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// File: /bootstrap/app.php | |
.. | |
$app = new Illuminate\Foundation\Application( | |
realpath(__DIR__.'/../') | |
); | |
$app->bind('path.public', function () | |
{ | |
return base_path() . '/'; | |
}); | |
.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If you are using Croppa on images dir | |
Croppa::url('subdir/images/' . $image, $width, $height, array('resize')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// File: /index.php (After move public content to root) | |
.. | |
require __DIR__.'/bootstrap/autoload.php'; | |
.. | |
$app = require_once __DIR__.'/bootstrap/app.php'; | |
.. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment