Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

HTTP headers | Content-Location

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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
    Last Updated : 07 Nov, 2019
    Like Article
    Save Article
    Similar Reads
    Related Tutorials