Remove 'public' from URL - Laravel

0

I'm accessing my site like this: link

I would like to just type link because I want it to work when I enter the domain as well.

Is there any way to resolve this without being changed by folders, but only via code? I do not understand almost anything about .htaccess.

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
    
asked by anonymous 08.05.2015 / 18:08

1 answer

1

Resolution - I do not know if it's for the best. Follow below:

I've trimmed the .htaccess and index.php files from the public folder and pasted it into the root folder of my site.

And within index.php I changed the path of the start folders in the application.

From

require __DIR__.'../bootstrap/autoload.php';
$app = require_once __DIR__.'../bootstrap/start.php';

To

require __DIR__.'/bootstrap/autoload.php';
$app = require_once __DIR__.'/bootstrap/start.php';

But will it always have to be this way? In this case I am inside a folder in the www (public_html) folder of the hosting.

I do not think so, but ...

    
08.05.2015 / 20:18