Jump to content

Recommended Posts

Please I need help about relative path. I am confusing this relative file path. I understood other relative path but this relative path very confusing I feel.

image.png.ec4d7f3f15e637a1e891332f40772e1a.png

I need clear concept of this relative path.

Link to post
Share on other sites
  • 3 weeks later...
On 1/12/2021 at 7:30 AM, lokudolem said:

The first slash is directory root for more subfolders before images folder.

It's the http root which is not the same as your file system root. This is because you don't want to put your entire file system online. It is configurable on your file server. And the first part of the URL is handled by a DNS lookup, so that vistor to your site are directed to your computer at whatever IP address it has been registered.

So say you are using Apache  on a server running Linux then there will be a file called /etc/httpd/conf/httpd.conf

In that (text) file will be a line saying something like:

 DocumentRoot "/srv/http"

The actual file that visitors access thus will be /srv/http/images/picture.jpg but your web pages can reference them as  /images/picture.jpg 

  • Thanks 1
Link to post
Share on other sites
1 hour ago, melahi said:

It's the http root which is not the same as your file system root. This is because you don't want to put your entire file system online. It is configurable on your file server. And the first part of the URL is handled by a DNS lookup, so that vistor to your site are directed to your computer at whatever IP address it has been registered.

So say you are using Apache  on a server running Linux then there will be a file called /etc/httpd/conf/httpd.conf

In that (text) file will be a line saying something like:


 DocumentRoot "/srv/http"

The actual file that visitors access thus will be /srv/http/images/picture.jpg but your web pages can reference them as  /images/picture.jpg 

 

Thank you very much. I try to find a solution to this in many places. But I did not get the right decision. In the end I think it must be related to the server that got the solution in your answer.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...