Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
02-27-2014, 03:32 AM #1
- Join Date
- Jun 2006
- Thanked 3 Times in 3 Posts
How does web servers serve Media with relative path?
I have been trying to find an answer to this for long but no dice so finally posting it here hoping someone can help me understand the concept.
Consider the following HTML code:
<!--index.html--> <html> <head> <title>Welcome</title> </head> <body> <img src="images/banner.png" /> </body> </html>
Suppose I have an apache web server running on a machine and the web root folder has the above index.html as well as the banner.png image sitting under the "images" directory under web root. A user requests the page from a remote location using the server's domain http://phantom007.com, the user's browser will render the html page along with the image.
Now the question(s).
Since the image source in the above index.html file has a relative path (images/banner.png) and not an absolute path (http://phantom007.com/images/banner.png), then:
1) How does the user's browser render the image that has a relative path in a remote location?
2) Does the image file also gets transferred to the client's machine?
3) If the answer to the above is "yes", in which medium / format does it get transferred? I mean via the headers or something else?
Thanks for any inputs.
03-01-2014, 06:53 PM #2
- Join Date
- Aug 2003
- Wake Forest, North Carolina
- Thanked 215 Times in 212 Posts
Dave .... HostMonster for all of your hosting needs