[Solved] Route not working on a live server in Laravel Home route working

Home route work, another route not work.

If you are trying to lunch you website to the live server? while transfer local to live server sometime comes errors.

Local web development environment and live server environment doesn’t match and you need to setup properly.

If your .env file is working good or setup properly then comes error like this.

Home page route works perfectly and while try to click on pages, submenu or menu or category and another word if you try to access or open by slug then website not respond.

and comes 404 page not found.

while I searched on google for the same problem like

Laravel routes not working on live server

then I got suggestion to config or edit .htaccess file like this

But it’s not need to do.

You need only simple and easy tips to solve this problem.

Now do not follow this

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

    RewriteEngine On
    RewriteBase /var/www/gloops/public/
   # change above to your site i.e.,  RewriteBase /whatever/public/

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

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

let’s think, If this work on local host properly why not work for live server?

Live server is different? no it’s not.

so. you don’t do anything.

Follow the tips below for Route not working on a live server in Laravel

  1. check your index.php page where is located in.
  2. check your .htaccess file where is located.

in local host you don’t need to change and on the live server sometime you transfer public to outside public

3. Index.php and .htaccess file always to be same directory.

find the .htaccess file on your hooting server .htaccess file hide by default, and you need to un hide clicking from

how to display hidden file on server cPanel image
how to display hidden file on server cPanel image

If you are not finding the .htaccess file after show hidden file from setting then again upload from local single .htaccess file on the same directory where is your index.php file.

Laravel .env file .htacces file and index file at same directory
Laravel .env file .htacces file and index file at same directory

Yes, You need to make at the same directory .htaccess file and index file.

It’s done.

I hope, this information was helpful.

Base table or view not found: 1146 Table ‘.migrations’ doesn’t exist. migration table not found in Laravel

Leave a Reply