Level 18
Check to make sure MOD_REWRITE is enabled on your server..
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
My routes work fine on my local machine, but once I upload them in the hosting server, they don't work at all. Only the homepage works.
How can I fix this?
Here's my web.php file:
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', 'PagesController@index')->name('home');
Route::get('/about', 'PagesController@about')->name('about');
Route::get('/services', 'PagesController@services')->name('services');
Route::resource('/posts', 'PostsController');
Route::resource('/comments', 'CommentsController');
Route::resource('/category', 'CategoryController');
Auth::routes();
Route::get('/dashboard', 'DashboardController@index');
Route::get('posts/{id}/duplicate', 'PostsController@duplicate');
Route::get('/logout', '\App\Http\Controllers\Auth\LoginController@logout');
Route::get('/dashboard/category/create', 'CategoryController@create');
Route::get('/dashboard/category', 'DashboardController@index_category');
Route::get('/dashboard/posts', 'DashboardController@index_posts');
And here's a link to my hosted app: lekham.ushostserver.com
try to check the .htaccess
Please or to participate in this conversation.