GATE CS 2015 Set 3 — Question 18
Go beyond PYQs with Success TrackerAI-powered personalised practice and doubt support. Unlimited practice on eligible plans; AI usage limits apply.MCQ+1 / -0.33MediumHTTP & HTTPSApplication LayerComputer Networks
Computer Networks → Application Layer → HTTP & HTTPS
Last updated
Question
In a web server, ten WebPages are stored with the URLs of the form http://www.yourname.com/var.html; where, is a different number from 1 to 10 for each Webpage. Suppose, the client stores the Webpage with (say W1) in local machine, edits and then tests. Rest of the WebPages remains on the web server. W1 contains several relative URLs of the form “var.html” referring to the other WebPages. Which one of the following statements needs to be added in W1, so that all the relative URLs in W1 refer to the appropriate WebPages on the web server?
Correct answer
(B) <base href: "http://www.yourname.com/"
Solution
Relative URLs in a page are resolved against the page's base URL. When W1 is opened from the local machine, its base URL is the local file path, so a link such as
2.html would point to a local file instead of the web server.The HTML <base> tag sets the base URL used to resolve every relative URL in the document. Adding a base tag whose href is http://www.yourname.com/ makes 2.html resolve to http://www.yourname.com/2.html, and so on for all the other pages.- (A) and (C) are anchor (
<a>) tags: they create a single hyperlink and do not change how other relative URLs are resolved. - (D) uses a base tag but adds a non-existent
rangeattribute; it is not a valid statement. - (B) is the base tag with the server's root as
href(the paper writes the attribute with a colon), which is exactly what is needed.
Continue learning with Success Tracker
A step still unclear? Work through it with support
Use Success Tracker to ask about the reasoning, then try another GATE CS question to check your understanding.
AI-powered practice· Unlimited practice on eligible plans
- PYQs with solutions
- Attempt available previous-year questions, then compare your reasoning with the worked solution. Coverage varies by stream.
- Practice that adapts
- Choose a topic, work on weaker areas and bookmark questions to revisit. Your attempts feed your progress tracking.
- AI doubt support
- Ask follow-up questions about a step or concept while practising, instead of stopping at the final answer.
Unlimited practice is available on eligible plans. Free practice and AI usage have limits; check the current plan allowances before choosing.
This page stays readable without an account. AI responses can be wrong; check them against the solution and source material.
More questions on Application Layer
2026 Set 1 Q18With respect to a TCP connection between a client and a server, which one of the following…2026 Set 1 Q19Which of the following statements is/are true with respect to the interaction of a web browser with…2026 Set 2 Q21Consider a file of size 4 million bytes being transferred between two hosts connected via a path…2026 Set 2 Q22Which one of the following protocols may need to broadcast some of its messages?2026 Set 2 Q33If an IP network uses a subnet mask of 255.255.240.0, the maximum number of IP addresses that can…