HTTP headers | Content-Location
The HTTP Content-Location header is an entity-header that gives another location for the data that is returned and also tells how to access the resource by indicating the direct URL. Its usage is often confused with another HTTP Header which is Location. The main difference between them is that Location gives the URL of the resource where the redirection of the page happens while HTTP Content-Location is used to indicate the URL of a transmitted resource.
Directives: This header accepts a single directive mentioned above and described below:
- <url>:This directive holds the relative or absolute URL that gives access to a resource.
Examples:In this example, index.html is the URL which indicated the location of the content.
Content-Location: /index.htmlIn this example, teddy.xml is the URL which indicates the location of the content.
To check this Content-Location in action go to Inspect Element -> Network check the response header for Content-Location like below.
Supported Browsers: The browsers are compatible with the HTTP Content-Location header are listed below:
- Google Chrome
- Internet Explorer