Forum Moderators: phranque
I have a question concerning mod_rewrite and linked css pages and images. If I set up the rewrite rule to change:
mysite.com/index.php?tm=04&lm=02
into
mysite.com/research/02.htm
I lose the link to my css stylesheet and to image files. I could just change all the relative urls to fully qualified urls, but was hoping for another solution. This is probably a trivial question, but I am very new to mod_rewrite...
Thanks,
ajkimoto
Canonical: <img src="http://www.example.com/logo.gif">
Server-relative: <img src="/logo.gif">
It helps to keep in mind that it is the browser that resolves relative links. Once you focus on that fact, resolving this kind of problem is quite a bit easier.
Also it helps to keep in mind that your are rewriting the static URL request to a dynamic internal filepath; That is, mod_rewrite changes the filepath that a URL references, and it does so just after the HTTP request is received, and before any content-handlers or scripts are invoked.
Jim