Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel routing working on local server but not on cpanel

Tags:

php

laravel

I am working on laravel 5.5.33. I have created few pages like index.blade.php, about.blade.php etc. in view folder.

The routing for both the pages are working perfectly on local machine. Then I migrated the project folder to my shared hosting. The routing for the page index.blade.php is working perfectly but the same function is not working for any other file e.g about.blade.php.

web.php

// This function is working for index file
 Route::get('/', function () {
    return view('index');
});

// This function is not working for about file
Route::get('about', function () {
    return view ('about');
});

header.blade.php

<ul>
<li class="mega-menu"><a href="/">Home</a></li>
<li class="mega-menu"><a href="about">About Us</a></li>
<ul>
like image 437
Jeet Patel Avatar asked Oct 17 '22 23:10

Jeet Patel


1 Answers

I Think You Have Just Moved You .htaccess file from the public or public_html folder.

You have to copy it not cut/move it.

Just paste a copy of .htaccess file in public or public_html folder and it's done.

like image 105
Sandeep Rana Avatar answered Oct 21 '22 05:10

Sandeep Rana