Search code examples
laravellaravel-5xampplocalhost

Xampp localhost not working


I am running laravel on xampp and I have problem with accessing pages, http://localhost/laravel/public/ I get a login page which is good however when I go for example http://localhost/laravel/public/smokeyard

I get 404 error with The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

Route:

Route::get('smokeyard', 'GuzzleController@smokeyard');

Controller:

function smokeyard(){
    return view('smokeyard');
}

All my views are located in resources folder.


Solution

  • if you want to access laravel project without running artisan serve, you need to change few settings,

    1. copy the .htaccess file from the public folder and paste it in the root folder of your application

    2. rename the server.php in the root directory to index.php

    now go to localhost/your_project_name/smokeyard for the url you want to check

    hope this helps