开发者

Friendly url rewriting with php & .htaccess. Difficulties with relative links to css images & js

I've currently an url like that : play.php?place=idplace&event=idevent

I've enabled friendly url this way :

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

For just one parameter (the place id there), all is ok. But when it comes two params (place and event) like that mysite/theplace/theevent all my relatives links (css, js and imgs) are not working, my page seems to think it is actually in the the开发者_Go百科place/ folder, and non in the root/ one.

Ideas for this issue?

Thanx a lot

Guillaume


You must use paths that are absolute from at least the domain, i.e.

/images/myimage.png

You may be able to fix this one problem in another way, but it will only become more annoying as your URL rewriting becomes more advanced.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜