getURLRoot())); $file_path = explode('?', $file_path)[0]; $custom_file = $oConf->getPathCustom($file_path); $native_file = $oConf->getPathRoot($file_path); if(file_exists($custom_file)){ $file = $custom_file; } elseif(file_exists($native_file)) { $file = $native_file; } else { header('HTTP/1.1 404 Not found', true); exit(0); } $is_css = preg_match('/\.css$/', $file); $is_js = preg_match('/\.js$/', $file); $is_php = preg_match('/\.php$/', $file); if($is_php){ include($file); exit(0); } else if($is_css){ $type = 'text/css'; } else if($is_js){ $type = 'text/javascript'; } else { $finfo = finfo_open(FILEINFO_MIME_TYPE); $type = finfo_file($finfo, $file); finfo_close($finfo); } header('Content-Type: ' . $type, true); echo file_get_contents($file);