XAMPP: trying to add a router and I'm struggling with virtual hosts and apache clash

Hi, I am following the tutorial from https://laracasts.com/series/php-for-beginners and I’m on lesson 16, setting up a router.

When I do this in Xampp - my current filepath is htdocs/lessons/index.php

However, my router is set to look like this:

$router->define([

    "lessons" => "controllers/index.php",
    "lessons/about" => "controllers/about.php",
    "lessons/contact" => "controllers/contact.php"

]);

Therefore, I have added this to the httpd-vhosts.conf file:

<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/lessons" # make sure path is correct
    RewriteEngine On
    RewriteRule ^(.*)$ /index.php/

</VirtualHost>

However, this then means I can’t start my apache server through XAMPP. I’m a little stumped and I’ve been stuck on this for nearly 2 weeks…

This is my file structure:

Sponsor our Newsletter | Privacy Policy | Terms of Service