我目前的网址是这样的:play.php?place = idplace& event = idevent
我已经通过这种方式启用了友好网址:
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ play.php?place=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ /play.php?place=$1
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ /play.php?place=$1&event=$2
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/$ /play.php?place=$1&event=$2
对于一个参数(那里的地方ID),一切正常。但是当它出现两个params(地点和事件),就像mysite / theplace / theevent所有我的亲戚链接(css,js和imgs)都不起作用时,我的页面似乎认为它实际上是在theplace /文件夹中,而不是根/一。
这个问题的想法?
Thanx很多
纪尧姆
答案 0 :(得分:1)
您必须使用至少来自域的路径,即
/images/myimage.png
您可以用另一种方式解决这个问题,但只有当您的网址重写变得更加高级时,它才会变得更加烦人。