Webdev: August 2003 Archives

The moment I changed the looks of this site, I also changed the version of the code used for these pages. My site is now made up in XHTML version 1.1. I only forgot to change one thing. I did change some tags elements to their new variants, and of course I included the right DTD. But my pages were still served to your browser with the text/html MIME type, while the specification tells me that I should serve my pages as application/xhtml+xml.

Today I noticed something strange in the access report of this site. In the error codes list I found error 411. Since I haven't seen this error code before, I googled on internet for some more information.

The official RFC 2616 says the following: The server refuses to accept the request without a defined Content-Length. The client MAY repeat the request if it adds a valid Content-Length header field containing the length of the message-body in the request message.

It appears that a server is returning code 411 when a client (=browser) tries to send data to the server without specifying the size of the data. Normally a client only receives data from the server (reading pages), and all common modern browsers are programmed in such a way that they include the data length when sending data. Therefore I suspected that somebody with a home-grown application had tried to mess with my site.

I did a quick grep in my Apache log files and found out that somebody had accessed the file mt-xmlrpc.cgi with an application that identified itself as Java/1.4.1_01. This file is a XML-RPC interface to Movable Type, allowing other applications to interact with MT, for example to publish entries on this site from a special desktop client. Since I am the only responsible for this site, nobody but me has any reason to use this file. This visitor also triggered my Spam trap, and was already blocked from my system, but if not, his badly programmed application did ring the alarm bell.

When I designed this site, I of course tested the layout on my Windows computer. I know that it looks alright with IE6 and Mozilla, and I suspect that it looks acceptable in most other OS/browser combinations. If I would be a professional designer, I would run it through the famous BrowserCam, but my little site is not worth the money.

Of course there are some emulators available, which might give you an idea of how your site looks --- but remember that if something looks wrong you never know for sure whether it is your code or the emulator. A new emulator I found today, shows how this site looks on an iPaq PDA.

Mmmm. Header to big, no skip navigation link, useless side column, font too big, ... But still readable. I also loaded the Fimcap site, which still has a tables based layout, and that looked way worse. To read the text you have to keep on scrolling.

I guess I will have to make a new stylesheet, or maybe serve PDA's the print stylesheet. But the print stylesheet removes all the navigational elements... Anyway, the coming days I will tweak this site so it will look better for my mobile readers --- do I have any?

It has been three days ago since I switched my site to the new server. Little by little the visitors switched as DNS servers synchronised all over the world. And little by little I noticed some problems on my site.

These problems were related the two changes I made in the set-up of my site: I moved my photo gallery from its subdirectory /photos to its own sub-domain photos.braintags.com and I changed all URLs of the individual archives from entry_name.html to entry_name/index.shtml.

The first change broke all links to the photos --- and what is a photo gallery without photos? --- which I corrected by editing all 51 entries. Furthermore I still have to create a symbolic link to some files from my main site, like robots.txt.

The second change broke nothing on my site, but some links to my pages on other sites (Google!) broke terribly. Therefore I decided to us my good friend mod_rewrite to serve people the right page. All I had to do was to create a rule to redirect requests for /archives/yyyy/mm/entry_name.html to /archives/yyyy/mm/entry_name/. So I created the following rule:

# Redirect old URI's to future-proof directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (archives/[0-9]{4}/[0-9]{2}/.*)\.html$ $1/ [R=permanent]

This did a good job, except for two problems: it also redirected the URI of my monthly archives to archives/yyyy/mm/index/ and it added a slash in front of the URI, so the URL would look like http://jeroensangers.com//archives/.... The first problem was easily solved:

# Redirect old URI's to future-proof directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !index.s?html$
RewriteRule (archives/[0-9]{4}/[0-9]{2}/.*)\.html$ $1/ [R=permanent]

For the second problem I am still looking for a solution.

FOAF provides an execellent vocabulary for describing people and the relation between people. It is a way to describe yourself -- your name, email address, and the people you're friends with -- using XML and RDF. This allows software to process these descriptions, perhaps as part of an automated search engine, to discover information about your and the communities of which you're a member.

Of course I created a FOAF description of myself, using the FOAF-a-Matic. You can find my FOAF at http://braintags.com/foaf.rdf. If you link your FOAF to mine, please let me know, so I can update my file.

[Update 03.08.2003]: After seeing 23 404-errors in my logfile, I came to the conclusion that I must have saved the FOAF file with the wrong name. It is now fixed, so it should work alright.

For those people who are too lazy to look into the file, my FOAF description looks as follows:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:foaf="http://xmlns.com/foaf/0.1/">
  <foaf:Person>
    <foaf:name>Jeroen Sangers</foaf:name>
    <foaf:title>Mr</foaf:title>
    <foaf:firstName>Jeroen</foaf:firstName>
    <foaf:surname>Sangers</foaf:surname>
    <foaf:nick>Beltza</foaf:nick>
    <foaf:mbox_sha1sum>6fe5a1c9a2f3ce9d6a53d4f82d0e4a92254bba2b</foaf:mbox_sha1sum>
    <foaf:homepage rdf:resource="http://braintags.com/"/>
    <foaf:phone rdf:resource="tel:+34-6-19204630"/>
    <foaf:workplaceHomepage rdf:resource="http://www.icg.es/"/>
    <foaf:schoolHomepage rdf:resource="http://www.uu.nl/"/>
  </foaf:Person>
</rdf:RDF>