sonjoyray 0 Posted January 10 Report Share Posted January 10 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. I need clear concept of this relative path. Quote Link to post Share on other sites
dsonesuk 921 Posted January 10 Report Share Posted January 10 The first slash usually represents the root directory or domain name that is directed to that directory, images is a folder within that root directory and then the image within that images folder. 1 Quote Link to post Share on other sites
lokudolem 1 Posted January 11 Report Share Posted January 11 The first slash is directory root for more subfolders before images folder. 1 Quote Link to post Share on other sites
melahi 2 Posted January 29 Report Share Posted January 29 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 1 Quote Link to post Share on other sites
sonjoyray 0 Posted January 29 Author Report Share Posted January 29 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. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.