dongwupei7803 2011-06-16 21:57
浏览 23

网址重写问题css搞砸了

basically what im trying to do it :

http://mydomain.com/1/1

to

http://mydomain.com/index.php?mid=1&mpid=1

and im using these codes in htaccess.

RewriteEngine on
RewriteRule ^([^/]+)/([^/]+) index.php?mid=$1&mpid=2 [NC]

it works fine but the problem is that css get messed,its not loading css and images. whats the solution ?

  • 写回答

5条回答 默认 最新

  • duanqiang2617 2011-06-16 22:02
    关注

    The problem is that your CSS is no longer relative to the root of your site.

    Your index.php file is at /, but when you rewrite to /1/1, the client thinks you actually are at /1/1, and looks for the CSS file relative to that path, as it should.

    What you need to do is reference your CSS at the root, /style/something.css or whatever it is. Just make sure you have / at the front of that path.

    评论

报告相同问题?

悬赏问题

  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算