Forum Moderators: phranque
The situation is like this, I used mod_rewrite to redirect my ugly page like test.php?value=abc
The rewrite rule is:
RewriteRule ^/test/(.*)$ /test.php?value=$1 [L]
When I enter www.mydomain.com/test/123, the page indeed redirect to my test.php?value=123, which is all correct, but my test.php contains images links like src='images/123.gif' I noticed that after I used the above rewrite my images is loading a link from www.mydomain.com/test/images/123.gif which obviously cannot be found.
When I use [R,L] in the rewrite rule everything works fine though....
Anyone have any idea how to solve this?
Morchi
Therefore, a relative link like "images/123/" is resolved to the same directory as the page "123", plus "images/123.gif", yielding an image URL of example.com/test/images/123.
The simplest way to fix/avoid this problem is to always use server-relative or canonical URLs on your pages, such as
<img src=[b]"/i[/b]mages/123.gif">
<img src="http://www.example/com/images/123.gif">