I wrote a Typo-3 template which is working fine the problem is that when I call a "sub path" the image links aren't found anymore.
/index.php: every thing works fine
/test/index.php: images aren't found anymore
The problem is that no image url is an absolute path whether from TypoScript or from fileadmin via component.
Is there a way to force absolute path use everywhere?
I assume you use an extension to get nice URLs (coolUri
or realUrl
) so you get path segments for each page other than the root page.
So you have subfolders in your URL but always the index.php from your webroot is called.
Now you have images which by default are referenced relative to the working php script. As the working php script is /index.php
a path to fileadmin/img/image1.jpg
is correct.
But your browser thinks you are in path /test
and requests an image <domain>/test/fileadmin/img/image1.jpg
, which does not exist.
Either your browser needs to know which base to use for server pathes (setting base Url),
or (better) you provide absolute URLs for any resources. This can be done with a little typoscript configuration:
config.absRefPrefix = /