2013-05-10 17 views
0

我在使用URL与此规则重写在加载CSS文件和图像文件的问题:排除在URL CSS文件和图像重写PHP

RewriteEngine on 
RewriteRule ^showProject-([^/]+)-([0-9]+)\.html$ showProject.php?id=$2 

我得到这个网址:

localhost:8080/coders_ring/project/test/1.html 

真正的网址是:

localhost:8080/coders_ring/showProject.php?id=1 

也是我在获取URL CSS文件测试这样的而不是解决方案:

<link href="style/master_style.css" rel="stylesheet" type="text/css" /> 
<link href="/style/master_style.css" rel="stylesheet" type="text/css" /> 

任何机构都有一个解决方案来加载CSS和图像文件与此URL重写?

回答

0

尝试添加一个基地href标记在showproject.php文件

添加此

<base href="http://localhost/coders_ring/" />