Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1105509 of Content-Location

  • Revision slug: Web/HTTP/Headers/Content-Location
  • Revision title: Content-Location
  • Revision id: 1105509
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

{{HTTPSidebar}}

The Content-Location header indicates an alternate location for the returned data. The principal use case is to indicate the URL of the resource transmitted as the result of content negotiation.

{{HTTPHeader("Location")}} and Content-Location are different: {{HTTPHeader("Location")}} indicates the target of a redirection (or the URL of a newly created document), while Content-Location indicates the direct URL to use to access the resource, without the need of further content negotiation. Location is a header associated with the response, while Content-Location is associated with the entity returned.

Header type {{Glossary("Entity header")}}
{{Glossary("Forbidden header name")}} no

Syntax

Content-Location: <url>

Directives

<url>
A relative (to the request URL) or absolute URL.

Examples

Content-Location: /index.html

Specifications

Specification Title
{{RFC("7231", "Content-Location", "3.1.4.2")}} Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content

Browser compatibility

{{Compat}}

See also

  • {{HTTPHeader("Location")}}

Revision Source

<div>{{HTTPSidebar}}</div>

<p>The <strong><code>Content-Location</code></strong> header indicates an alternate location for the returned data. The principal use case is to indicate the URL of the resource transmitted as the result of <a href="/en-US/docs/Web/HTTP/Content_negotiation">content negotiation.</a></p>

<p>{{HTTPHeader("Location")}} and <code>Content-Location</code> are different: {{HTTPHeader("Location")}} indicates the target of a redirection (or the URL of a newly created document), while <code>Content-Location</code> indicates the direct URL to use to access the resource, without the need of further content negotiation. <code>Location</code> is a header associated with the response, while <code>Content-Location</code> is associated with the entity returned.</p>

<table class="properties">
 <tbody>
  <tr>
   <th scope="row">Header type</th>
   <td>{{Glossary("Entity header")}}</td>
  </tr>
  <tr>
   <th scope="row">{{Glossary("Forbidden header name")}}</th>
   <td>no</td>
  </tr>
 </tbody>
</table>

<h2 id="Syntax">Syntax</h2>

<pre class="syntaxbox">
Content-Location: &lt;url&gt;
</pre>

<h2 id="Directives">Directives</h2>

<dl>
 <dt>&lt;url&gt;</dt>
 <dd>A relative (to the request URL) or absolute URL.</dd>
</dl>

<h2 id="Examples">Examples</h2>

<pre>
Content-Location: /index.html</pre>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Title</th>
  </tr>
  <tr>
   <td>{{RFC("7231", "Content-Location", "3.1.4.2")}}</td>
   <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p class="hidden">The compatibility table in this page is generated from structured data. If you’d like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data/README.md">https://github.com/mdn/browser-compat-data/README.md</a> and send us a pull request.</p>

<p>{{Compat}}</p>

<h2 id="See_also">See also</h2>

<ul>
 <li>{{HTTPHeader("Location")}}</li>
</ul>
Revert to this revision