php – Rewrite url not working, only blank screen-ThrowExceptions

Exception or error:

I’m trying to rewrite my urls to seo friendly url.

I would like to change:




RewriteEngine on  
RewriteCond %{REQUEST_FILENAME} !-f  
RewriteCond %{REQUEST_FILENAME} !-d  
RewriteRule ^(.*)$ /index.php [L,QSA]

# redirect "/product.php?title=..." to "/product-bekijken/..." to hide a directly accessed "ugly" url
RewriteCond %{THE_REQUEST} \s/product-bekijken\?title=(.+)\s [NC]
RewriteRule ^ /product-bekijken/%1? [R=301,L]

# internally rewrite "/product-bekijken/..." to "/product.php?title=..."
RewriteRule ^product-bekijken/(.+)$ /product-bekijken?title=$1 [L]

This is my View.php where i load the template assets and pages. in the view folder are the template page files

<!DOCTYPE html>
<html lang="nl">
        <div id="preloder">
            <div class="loader"></div>
        <?php include_once($CONFIG->get_templatesettings('TEMPLATE_ROOT') . '/includes/header.php'); ?>
        <?php include_once($CONFIG::get_templatesettings('TEMPLATE_ROOT') . '/views/' . $PAGE::get_page() ); ?>
        <?php include_once($CONFIG->get_templatesettings('TEMPLATE_ROOT') . '/includes/footer.php'); ?>
        <?php include_once($CONFIG->get_templatesettings('TEMPLATE_ROOT') . '/includes/scripts.php'); ?>

It will redirect the url i want, but the page with only the header and footer, but the product view is blank.

Below is the display.class.php

class view{

    private static $page;

    public static function set_page(){

        //This is for developers
        //ini_set('display_errors', 'On');

        //What page should be displayed.
        $file = strtok( basename($_SERVER["REQUEST_URI"]) , '?');

            //Api access point
            case '':
                self::$page = 'index.php';

            case 'product-bekijken':
                self::$page = 'product.php';
    public static function get_page(){
        return self::$page;
How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *