Skip to content
Related Articles

Related Articles

HTTP headers | Content-Location
  • Last Updated : 07 Nov, 2019

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.

Syntax:

Content-Location: <url>

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.html
  • In this example, teddy.xml is the URL which indicates the location of the content.
    Content-Location: /teddy.xml

    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
    • Opera
    • Firefox
    • Safari
    My Personal Notes arrow_drop_up
  • Recommended Articles
    Page :