Apache HTTP Headers Easter Egg

picture

Apache HTTP Headers Easter Egg

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.

  1. Date: Tue, 25 May 2010 17:35:48 GMT
  2. Server: Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.7 with Suhosin-Patch mod_ssl/2.2.8 OpenSSL/0.9.8g
  3. X-Powered-By: PHP/5.2.4-2ubuntu5.7
  4. Last-Modified: Sat, 22 May 2010 20:29:05 GMT
  5. Etag: "0cd4e56987fc6107ccfbe1bd53b7db53"
  6. Expires: Sun, 19 Nov 1978 05:00:00 GMT
  7. Cache-Control: must-revalidate
  8. Content-Encoding: gzip
  9. X-FTW: All your bases are belong to me
  10. X-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.
  11. X-Developer: Adam A. Gregory
  12. Content-Length: 7777
  13. Keep-Alive: timeout=15, max=100
  14. Connection: Keep-Alive
  15. 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

  1. Developed-By: Adam A. Gregory
  2. Ultimate-Answer: 42
  3. Ultimate-Question: ?
  4. X-Server: Deep Thought
  5. 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.

  1. #My custom headers for a little Easter egg surprise
  2. <IfModule mod_headers.c>
  3. Header set Developed-By "Adam A. Gregory"
  4. Header set Ultimate-Answer "42"
  5. Header set Ultimate-Question "?"
  6. Header set X-Server "Deep Thought"
  7. Header set Computational-Matrix "Earth"
  8. </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.

Comments (1)

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

The content of this field is kept private and will not be shown publicly.
Image CAPTCHA
Enter the characters shown in the image.

Search Site

Latest Posts

picture
One of Drupal longtime woes has been it’s GUI. It has...
picture
Long time users of Drupal will be familiar with Fields...
picture
I use SSH on an hourly basis and am often logging into...
picture
One of the most common tasks in module development is...

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