douqingnao9246 2014-07-20 23:41
浏览 33
已采纳

Css包含在PHP中实现modrewrite时不工作

I am working on wamp. the link to my site is : localhost/tshirtshop/

Before rewriting it is : localhost/tshirtshop/index.php?product=12

After rewriting it is : localhost/product-title-p12

Problem: Everything is working fine. but the problem is with Css files.

This file is not including.. when i saw the source code (Ctrl+U) the path is like this :

localhost/tshirtshop/product-title-p12/styles/tshirtshop.css

What i tried:

I tried this

<style>
    <?php include 'styles/tshirtshop.css';
   </style>

It works but not a solution for me. as there are some other images to be included also i.e logo which results as this path: localhost/tshirtshop/product-title/images/tshirtshop.png

It might be a very easy solution. But i am facing problem since one hour. i tried googling for similar problems but not found any. so please dont mind. and sorry for my english.

  • 写回答

4条回答 默认 最新

  • duanboshe0001 2014-07-20 23:49
    关注

    use absolute path like

    <link rel="stylesheet" type="text/css" href="http://localhost/tshirtshop/styles/tshirtshop.css" />
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 identifier of an instance of 类 was altered from xx to xx错误
  • ¥100 反编译微信小游戏求指导
  • ¥15 docker模式webrtc-streamer 无法播放公网rtsp
  • ¥15 学不会递归,理解不了汉诺塔参数变化
  • ¥30 软件自定义无线电该怎样使用
  • ¥15 R语言mediation包做中介分析,直接效应和间接效应都很小,为什么?
  • ¥15 Jenkins+k8s部署slave节点offline
  • ¥15 如何实现从tello无人机上获取实时传输的视频流,然后将获取的视频通过yolov5进行检测
  • ¥15 WPF使用Canvas绘制矢量图问题
  • ¥15 用三极管设计一个单管共射放大电路