How to set custom HTTP headers in Apache (by editing .htaccess)

Apache: How to set custom HTTP headers in Apache (by editing .htaccess)

  1. Header always set YOURHEADERNAME "Your Header Value"
  2. Header always set Referrer-Policy "strict-origin-when-cross-origin"
  3. Header set Content-Language "en-gb"

webdevetc profile pic
webdevetc

I am a 29 year old backend web developer from London, mostly focusing on PHP and Laravel lately. This (webdevetc.com) is my blog where I write about some web development topics (PHP, Laravel, Javascript, and some server stuff). contact me here.



More...


Comments and discussion about How to set custom HTTP headers in Apache (by editing .htaccess)

Found this interesting? Maybe you want to read some more in this series?

Or see other topics in the Apache language

Or see other languages/frameworks:
PHP Laravel Composer Apache CentOS and Linux Stuff WordPress General Webdev and Programming Stuff JavaScript
Or see random questions

How to return an item in Eloquent, or throw a ModelNotFoundException exception if it isn't found?

What is the difference between ( for ... in ) and ( for ... of ) in javascript?

How to select all rows for a certain month (or day, year or time), using Eloquent

How to get the last character of a string in JS?

What are PHP's PSRs?

How to fix the MySQL related "Specified key was too long error" error in Laravel

How to hide certain file types from directory listings

How do you access the php://input stream?

How to replace whitespace with a single space

What is the max size, by default, of GET variables?