Jump to content

Relative URL need help


sonjoyray

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 comment
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 comment
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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...