Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Dave Wize's avatar

Production site only loads the home page!

Hi everyone.

I'm uploading a project for a customer on a cPanel shared hosting server. (I'm not an expert on this type of hosting as I use the digital ocean and Forge for hosting).

But I'm facing a weird problem, the / home page loads successfully, but all other routes aren't loading. It is not loading the laravel 404 page, just a static server 404 page.

And this is weird because if it doesn't route the traffic to routes/web.php, the home page shouldn't work either.

Any help?

0 likes
1 reply
LaryAI's avatar
LaryAI
AI
Best Answer
Level 58

This issue could be caused by a few different things, but here are a few potential solutions to try:

  1. Check your .htaccess file: Make sure that your .htaccess file is properly configured to handle URL rewriting. If you're using Laravel's default .htaccess file, it should look something like this:
<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]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
  1. Check your routes/web.php file: Make sure that your routes are properly defined in your routes/web.php file. Double-check that you're using the correct HTTP verbs (e.g. GET, POST, etc.) and that your routes are pointing to the correct controllers and methods.

  2. Check your server configuration: It's possible that your server is not properly configured to handle Laravel's routing. Check with your hosting provider to make sure that they support Laravel and that your server is properly configured.

  3. Clear your cache: Sometimes Laravel's cache can cause issues with routing. Try running the following commands to clear your cache:

php artisan cache:clear
php artisan route:clear
php artisan view:clear

Hopefully one of these solutions will help you resolve the issue!

Please or to participate in this conversation.