Page 1 of 1

sub folder

PostPosted: 10. December 2016 15:13
by jomla
Hi at all
online with OS linux apache accept <img src="../images/image.png">
instead xampp accept <img src="images/image.png">

What is always right?

Re: sub folder

PostPosted: 10. December 2016 17:19
by gsmith
it all depends on folder structure and where the calling document is

<img src="images/image.png">
Code: Select all
/home
  |- /docroot        <-- calling document (*.html/php/etc.) is here
        |- /images   <-- images are here

<img src="../images/image.png">
Code: Select all
/home
  |- /docroot
        |- /images   <-- images are here
        |- /subdir   <-- calling document (*.html/php/etc.) is here

Re: sub folder

PostPosted: 10. December 2016 22:07
by Nobbie
gsmith wrote:it all depends on folder structure and where the calling document is


.. and also it depends on the setting of DocumentRoot, it depends on ALIAS Definitions and last not least on rewrites/redirects/proxies/reverse proxies etc. in .htaccess and/or in the Apache configuration. And i am still unsure, if i haven't overlooked something...

Re: sub folder

PostPosted: 11. December 2016 20:32
by gsmith
Nobbie wrote:.. and also it depends on the setting of DocumentRoot, it depends on ALIAS Definitions and last not least on rewrites/redirects/proxies/reverse proxies etc. in .htaccess and/or in the Apache configuration. And i am still unsure, if i haven't overlooked something...


Well /docroot = DocumentRoot and of course there are many variables as you state but I did not want to muddy the waters for a simple question that for most, not all, has a simple answer. I simply wanted to give the poster the general idea of how relative paths work ... which is what these both are.

I do thank you for pointing out the fact that it can rely on so much more than I have shown.

Re: sub folder

PostPosted: 12. December 2016 12:40
by Nobbie
gsmith wrote:I simply wanted to give the poster the general idea of how relative paths work ... which is what these both are.


Thats definateky ok, i only wanted to give a slight clue, that there might happen tons of unexpected things (which of course usually is not the case). My bigger concern with this question is, that i do not have a feeling what the author REALLY wants to know and what the REAL problem is (i dont know, if there is a problem, but i think so). The question "what is always right?" is a lttle bit "fuzzy", it would be easier to describe a problem and ask for a solution.