silkAdmin
silkAdmin

Reputation: 4810

HTTP header construction

Given 2 links:

<a href="/somepage.html">link1</a>
<a href="somepage.html">link1</a>

On a page at this domain:

www.site.com/index.html.

Are both the header request going to look the same ? Or can i expect a "/somepage.html" and "somepage.html" request to the site.com domain ?

EDIT: Here is what i see in the raw header in Chrome console:

GET /resources/css/jquery-ui.css HTTP/1.1
Host: site.com
Connection: keep-alive
Cache-Control: no-cache
Pragma: no-cache
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_1) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1
Accept: text/css,*/*;q=0.1
Referer: http://site.com/

So to clarify the question is the request parsed by rewrite engines only the first line? If so i can use ^/resource for instance to target it ?

Upvotes: 2

Views: 439

Answers (1)

Brad
Brad

Reputation: 163232

Both will look the same. /somepage.html

The browser creates /somepage.html, knowing that it is relative to the current document which is in /. The browser always requests the full path from the server. This is required, as the server doesn't know what page the browser is currently on. HTTP is inherently stateless.

Upvotes: 3

Related Questions