I’m using rewriteurl on my site so and url like this:
Which is refering to:
Now when linking to images in my script I usely do it like this:
Now the “images” folder is inside my subfolder but when running script it shows nothing and the imagelink looks like this:
How do I link to my images the normal way? Should I rewrite all my link to the images or is there an easier way?
Lucky for you there is a easier way, the HTML base tag.
<base href="/" />
in your HTML (see link as to where and how)
Guys, IMHO it’s easier to use an (internal) absolute link to images, css, js, etc., rather than relative links OR requiring all (relative) links to be referenced to the DocumentRoot (as Rémon’s suggestion with the base tag does).
That means <img src=“images/myimage.gif”> would simple be changed to <img src=“/images/myimage.gif”>. The base tag would force the leading / but require the same treatment in the subfolder directory, too.