Skip to content

PHP built in server

Robert Isoski edited this page Dec 8, 2018 · 4 revisions

Add support for PHP built in server

This gives a nice and quick way of getting started locally.

How to

Add a file called router.php:

<?php

if(pathinfo($_SERVER["REQUEST_URI"], PATHINFO_EXTENSION)) {
    // asset file; serve from filesystem
    return false;   
} else {
    $_GET['page'] = parse_url($_SERVER["REQUEST_URI"])['path'];
    include 'index.php';
}
NOTE: This is not an official functionality from WonderCMS and is intended for local use only.

Credits for tutorial: @jellehak (thank you!)

Clone this wiki locally