PHP 7.4.11 -> Проблема с кодом

суть проблемы: 1.не работает фильтр на preg_match 2. не работает CSS

Есть сервер -> Php 7.4.11 OpenSSL 1.0.2h Apache 2.4.23 (win32) Smarty 3.1.36 Released

Есть index.php -> в котором есть Smarty

<?php
require 'libs/Smarty.class.php';
$smarty = new Smarty;
$smarty->debugging = false;
$smarty->caching = false;
$smarty->cache_lifetime = 120;

$dsn = 'mysql:host=localhost;dbname=test'; 
$login = 'root'; 
$passwd = ''; 
$db = new PDO($dsn, $login, $passwd, array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true)); 
$products = $db->prepare("select * from product"); 
$products->execute(); 
$products->setFetchMode(PDO::FETCH_LAZY); 
$smarty->assign('products',$products); 

if ($_SERVER['REQUEST_URI'] == '/') $page='home';
    else{
        $page = substr($_SERVER['REQUEST_URI'], 1);
        if (preg_match ('![a-z][0-9]{5,15}!', $page)) exit ('error url'); <--- 1 Проблема
    }

    if (file_exists($page . ".php"))
        {
            include $page . ".php";
        }
$smarty->display('index.tpl');

Есть .htaccess ->

AddDefaultCharset UTF-8
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
DirectoryIndex index.php
RewriteRule ^(.*)$ index.php [L]

Есть index.tpl ->

<head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="/css/style.css"> <--- 2 Проблема
</head>
<div id="body">
    {include "headers.tpl"}
    <div id="left_box">
    {include "sidebar.tpl"}
    </div>
    <div id="content">
            {include "product.tpl"} 
            {include "footer.tpl"}          
        </div>
</div>

Есть Product.tpl ->

{foreach $products as $product} 
  <div id="prod_block">
    <a href="prod.php?prod_id={$product.id}">
        <div id="prod_photo" style="background: url({$product.image}); background-size: 200px 200px;"></div>
        <div id="prod_title">{$product.title}</div>
    </a>

    <div id="prod_amount">Количество на складе: {$product.amount}</div>
    <div id="prod_preis">{$product.preis} т</div>
  </div>
{foreachelse}
    Нет товара
{/foreach}

Ответы (0 шт):