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 C++ 菜单窗口独立出来,可以随意移动放大缩小。
  • ¥15 java代码写在记事本上后在cmd上运行时无报错但又没生成文件
  • ¥15 关于#python#的问题:在跑ldsc数据整理的时候一直抱这种错误,要么--out识别不了参数,要么--merge-alleles识别不了参数(操作系统-linux)
  • ¥15 PPOCRLabel
  • ¥15 网友们我该怎么办啊,急
  • ¥15 混合键合键合机对准标识
  • ¥100 现在不懂的是如何将当前的相机中的照片,作为纹理贴图,映射到扫描出的模型上
  • ¥15 目标跟踪,计算机视觉
  • ¥15 魔霸ROG7 pro,win11.息屏后会显示黑屏,如图,如何解决?(关键词-重新启动)
  • ¥15 有没有人知道这是哪里出了问题啊?要怎么改呀?