简体   繁体   中英

How to set directory in header in php

I have a small problem with importing links. Once I started using pretty URL directories stops working. What can I do ?

Screenshots:

Before

在此处输入图片说明

After

在此处输入图片说明

Make your css and js links dynamic. For example:

<?php define( 'SCRIPT_ROOT',  'http://'.$_SERVER['HTTP_HOST'].'/' );?>
<link href="<?php echo SCRIPT_ROOT ?>site/static/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" media="all">

After this doesnt matter your directory structure.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM