I'm trying to autoload the stylesheets in my page but it isn't working it returns this in the console:
Resource interpreted as Stylesheet but transferred with MIME type text/html
I've found what the problem is but I'm not sure how to fix it yet. As the autoloader works on one page but not on the other.
Working page:
Request URL:http://php.dev/public/assets/css/custom.css
This is the correct url but on my other page it is:
Request URL:http://php.dev/riot/public/assets/css/custom.css
So for some reason it adds a part of the url 'riot' in the request url I'm not sure how to remove this so it could load the css style correctly.
Autoloader function:
public function loadCss(){
$folder = glob('./public/assets/css/*.{css}', GLOB_BRACE);
foreach ($folder as $filename) {
echo "<link type='text/css' rel='stylesheet' href='".$filename."'>";
}
}