Laravel 5.2仅在主页上保持公开显示

I'm setting up a laravel 5.2 site with cpanel.

I have the domain root pointing to `public' and the site is working.

However for the home/index page it constantly shows public in the url and comes up with a page not found error.

so for my expected url I enter www.example.com and it comes up with www.example.com/public

If I navigate to an expected page e.g. www.example.com/production the page gets shown correctly and the url is presented correctly

I've got the site working correctly in homestead and I've created another site and that works fine - just can't work this out!

here's the contents of my .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>

This is the standard set up

very confused - what's missing - what can I test?

You need to point web server to a public directory and restart it.

An example for VH:

DocumentRoot "/path_to_aravel_project/public"
<Directory "/path_to_aravel_project/public">

I guess you need to add extra line into .htaccess file

RewriteCond %{REQUEST_FILENAME} !-d

So complete code will be

<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 ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

Try this , move index.php from public to project root directory

modify index.php as

require __DIR__.'/bootstrap/autoload.php';

require __DIR__.'/bootstrap/autoload.php';