i am working on a website and i am looking for a way to include all my stylesheets and scripts relatively. Including the php-files is easy:
<?php include 'header.php'; ?>
or
<?php include '../header.php'; ?>
or by referencing the root-path:
<?php include '/header.php'; ?>
But: All the stylesheets and scripts are not loaded on pages located in ‘/products‘, because they are located relatively to the root-directory and not to root/products.
For example:
<link href="css/styles.css" rel="stylesheet">
Is there a way to include stylesheets and scripts relativlely, without taking care of where the page is located, that is calling header.php?
I am working on a local server with mamp and there are many websites in the mamp-directory.
Thanks in advance!
Tim