The HTTP Referer header is a request-type header that identifies the address of the previous web page, which is linked to the current web page or resource being requested. The usage of this header increases the risk of privacy and security breaches on a website but it allows websites and web servers to identify where the traffic is coming from. The Referer can not be sent by the browsers if the resource is the local file or data.
Directives: The HTTP Referer header accepts a single directive as mentioned above and described below:
- <url>: This directive is the address(partial or full) of the previous World Wide Web page which was followed by a link to the currently requested page.
Below examples illustrates the HTTP Referer header:
- In this example, geeksforgeeks.org is the address of the previous web page.
- In this example, google.com is the address of the previous web page.
To check the Referer in action go to Inspect Element -> Network check the request header for Referer like below. Referer header is highlighted.
Supported Browsers: The browsers are compatible with HTTP header Referer are listed below:
- Google Chrome
- Internet Explorer
- Microsoft Edge
- HTTP headers | Access-Control-Expose-Headers
- HTTP headers | Access-Control-Allow-Headers.
- HTTP headers | Access-Control-Request-Headers
- HTTP headers | Location
- HTTP headers | User-Agent
- HTTP headers | Link
- HTTP headers | Save-Data
- HTTP headers | Content-Type
- HTTP headers | X-Forwarded-Proto
- HTTP headers | X-XSS-Protection
- HTTP headers | X-Frame-Options
- HTTP headers | Last-Modified
- HTTP headers | Date
- HTTP headers | Cookie
- HTTP headers | Strict-Transport-Security
- HTTP headers | Expect
- HTTP headers | Accept-Encoding
- HTTP headers | Proxy-Authenticate
- HTTP headers | Content-Range
- HTTP headers | Content-Encoding
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.