php - Cannot read image files, css and script libraries using absolute and relative url -
from public_html folder redirecting domain specific folder load , view website. code written in php
. root folder of website home/new/www.mysite.com www.mysite.com folder of website contain index.php , assets.
i define root folder myroot
.
in index.php have line of code.
$mypaths = explode('/', ltrim($parse_url['path'], '/')); if($mypaths ['0']){ $mypaths ['0'] = "page"; if(file_exists($mypaths ['1'].'.php')){ $mybody = $mypaths ['1'].'.php'; } else $mybody = myroot.'/home.php'; }else{ $mybody = myroot.'/home.php'; } include(myroot.'/header.php'); include($mybody ); include(myroot.'/footer.php');
header.php
includes navigation of website , stylesheet linked. $mybody
body of website show. footer.php
footer of website.
from there, shows html code of site (no css style, no images!) tried change href link href="../assets/style.css"
href="<?=myroot?>/assets/style.css"
images. not image file , styles.
turning on display_errors
not getting error, browser's debug tool have errors, including:
1.resource interpreted stylesheet transferred mime type text/html:
2.uncaught syntaxerror: unexpected token <
, uncaught referenceerror: $ not defined
why absolute , relative url's not working here?
additional info: have .htaccess contains
order allow,deny allow options -indexes <ifmodule mod_rewrite.c> rewriteengine on rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . index.php?%{query_string} [l] </ifmodule>
i running website on server. pointing domain server's ip address using hosts file.
Comments
Post a Comment