Woffling On

Thursday, August 04, 2005

Page Rotation Complete

Doesn't it feel good when you wrestle with and solve a problem to your complete satisfaction. It certainly does to me. And yes, I am enjoying that feeling right now.

Yes, I have resolved the rotation issue. I now have several pages on my new site where a couple of dozen small clinical case descriptions randomly rotate on each fresh page load. This keeps the pages interesting for visitors who may need to visit the pages concerned several times in order to access other pages covering individual medicinal herbs. So the prime objective of providing a good visiting experience for the people who land on those pages has, I think, been met.

The great thing about the solution is that it uses standard SSI which ensures that loaded pages have complete text content and are therefore search-engine spider friendly. There is no JavaScript in the solution at all.

The program that handles the random assignment of cases to individual page requests is written in PERL. The standard includes also manage to work on regular HTML pages. I don't like changing some page extensions in a site to SHTML and I certainly don't like making them all SHTML when the vast majority don't need to be parsed.

What has me so chuffed is the way I did this. Actually it is precisely the way it is "supposed" to be done; straight out of the Apache Manual. In the manual it specifically says not to do it the way so many people are told to do it.

I found plenty of references to hacks and workarounds that all basically involved setting up either one's Apache conf file or doing the same thing in the .htaccess file to force the Apache web server to parse all HTML pages as if they were SHTML pages. Ugly stuff really. This achieves success for the pages that do happen to have "includes" at the price of unnecessary server workload.

The far more elegant and efficient method uses the so-called XBitHack. Now I know the reference to 'hack' is somewhat disconcerting, but you must remember that it comes from within the Apache community. With a server name of a-patch-ee and recollection of the history of the name, it not only seems less worrying, it actually seems appropriate.

What does it involve? Nothing more than setting the owner's permissions eXecute bit on the individual html files that need to be parsed. I made a simple entry in my .htaccess and then used my ftp application to CHMOD the bit and voila! ...it worked. It's very sayifying to use the right solution rather than the often recommended but wrong solution.

0 Comments:

Post a Comment

<< Home