GateAI
DNS and HTTP

GATE CSE 2015 Set 3 · Q8

MCQ1 markMedium

Time

In a web server, ten WebPages are stored with the URLs of the form http://www.yourname.com/varvar.html; where, varvar is a different number from 1 to 10 for each Webpage. Suppose, the client stores the Webpage with var=1var = 1 (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 "varvar.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?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: B) <code><base href: “http://www.yourname.com/”></code>

DNS and HTTP

When an HTML document contains relative URLs, the browser resolves them against a base URL.

  • By default, the base URL is the location of the document itself. If document W1 is stored locally, relative links like "2.html" will be resolved relative to the local file system path (e.g., file:///.../2.html), which fails to locate the pages on the remote web server.

  • The HTML <base> tag specifies the base URL/target for all relative URLs in a document.

  • By adding <base href="http://www.yourname.com/"> in the <head> section of W1, all relative links inside W1 will automatically resolve against http://www.yourname.com/, directing requests to the proper web server.

Thus, option (B) is the correct choice.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This DNS and HTTP previous year question is Q8 of the GATE CSE 2015 Set 3 paper. Find more GATE CSE PYQs on DNS and HTTP in Computer Networks, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related DNS and HTTP PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

DNS and HTTP in GATE CSE

DNS and HTTP has 18 GATE CSE PYQs across 15 papers from 2011 to 2026. 13 of them are 1-mark MCQs like this one, and it is the only one in GATE CSE 2015 Set 3.

How GATE tests DNS and HTTP

More from GATE CSE 2015 Set 3

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2015 Set 3 · Q8 · MCQ

In a web server, ten WebPages are stored with the URLs of the form http://www.yourname.com/var.html; where, var is a different number from 1 to 10 for each Webpage. Suppose, the client stores the Webpage with var = 1 (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?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.