Apache HTTP Headers Easter Egg
Awhile back I read a blog post(I can't remember where) on interesting HTTP headers and thought, "Hmm, that looks like fun". Ever since I've been in the habit of adding little easter eggs to the sites I build. Read on to see how.
I generally like to leave little snippets of interesting-ness buried in the HTTP headers of websites I build. It non-intrusive and unseen by normal viewers but is a little something extra for those geeks out there who like to look at stuff like that as I do.
Date: Tue, 25 May 2010 17:35:48 GMT
Server: Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.7 with Suhosin-Patch mod_ssl/2.2.8 OpenSSL/0.9.8g
X-Powered-By: PHP/5.2.4-2ubuntu5.7
Last-Modified: Sat, 22 May 2010 20:29:05 GMT
Etag: "0cd4e56987fc6107ccfbe1bd53b7db53"Expires: Sun, 19 Nov 1978 05:00:00 GMT
Cache-Control: must-revalidate
Content-Encoding: gzip
X-FTW: All your bases are belong to meX-Adam: Adam Gregory has approved of this sites development(unless it is no good, in which case it probably wasn't me that developed it), but not necessarily it's execution, design, layout, or content.X-Developer: Adam A. Gregory
Content-Length: 7777Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8
You can see some of the little things I like to put into the headers above. Other examples with all the regular apache stuff above taken out are
Developed-By: Adam A. Gregory
Ultimate-Answer: 42Ultimate-Question: ?
X-Server: Deep Thought
computational-matrix: Earth
Does this serve any real purpose? No not really, but it is a fun little way to add some nerdiness or a byline to sites where it wouldn't necessarily be appropriate (or wanted). The other reason I do this is to ensure, to a very basic extant (anyone who comes behind me on servers I don't run could remove them, but generally they go unnoticed), that I do have some trail to show potential clients and employers that I did in fact work on this site.
So how is this accomplished?
It's actually very easy and can be done a few different ways. Either at the server level, globally and for individual virtual hosts. Or using .htaccess if you don't have access to server config or just don't want to mess with it. Either way the code to do it is the same.
#My custom headers for a little Easter egg surprise<IfModule mod_headers.c>Header set Developed-By "Adam A. Gregory"
Header set Ultimate-Answer "42"
Header set Ultimate-Question "?"
Header set X-Server "Deep Thought"
Header set Computational-Matrix "Earth"
</IfModule>
You can see how that code corresponds to the example above and figure it out from there. As I said this code is the same whether you put it in .htaccess, httpd.conf, or a vhost.conf.
Have fun and if you do add some http headers to your site be sure to comment below and share the site so I can check out your header easter egg.
Search Site
Latest Posts
Get In Touch
Feel free to contact me about how I can help with your next Web project.
Telephone: 910-808-1717
E-mail: info@adamagregory.com


I looked this up and thought "Awesome". Since Alpha5 Bibud Social Web Desktop at bibud.com has had headers made of awesome. Thanks for the tip!
Add Your Comment