I have created a simple dashboard using Laravel and Filament with latest version.

After setting up the database and editing the .env file, when I deploy it to cPanel I can't load the Filament page, like the login UI. I just see the Laravel default page on / route and /admin route is showing me '404 resource not found' page.

Please help

I have edited the .env file to connect to MySQL from cPanel and, I can not see the Filament pages at all.

1

There are 1 best solutions below

0
On

There might be an issue in your .htaccess configuration. Here is a sample .htaccess that can handle a Laravel application routing in cPanel:

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

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Send Requests To Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>