1

i have a new Laravel 8 project. I have an issue with routing, all my routes allways return 404.

I running it on my local machine using xammp on windwos 10.

I created a virtual host called laravel.dev like this in "C:\xampp\apache\conf\extra\httpd-vhosts.conf"

<VirtualHost laravel.dev:8080>
    DocumentRoot "C:/xampp/htdocs/laravel/backend/public/"
    ServerName laravel.dev
    SSLEngine On
    SSLCertificateFile "C:/xampp/apache/conf/ssl.crt/server.crt"
    SSLCertificateKeyFile "C:/xampp/apache/conf/ssl.key/server.key"

    <Directory "C:/xampp/htdocs/laravel/backend/public/">
        Options Indexes FollowSymLinks
        DirectoryIndex index.php
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

In Windows host "C:\Windows\System32\drivers\etc\hosts"

127.0.0.1 localhost
127.0.0.1 laravel.dev

If i try to access by the browser

laravel.dev:8080

I get 404 - not found

But if i type it like

http://localhost:8080/laravel/backend/public/

it works

My route web.php is like this

<?php

use App\Http\Controllers\Auth\Web\LoginController;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| 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('/', function (){
  echo 'This is home';
});
Saul Montilla
  • 687
  • 6
  • 16

0 Answers0