Redecorating the place II

posted in: Random, Technicalities, www | 0

After almost eight years using (and helping develop) Polypager, a very versatile and friendly content management system, and after three years of having Zenphoto manage my pictures, I finally decided I had to retire both and move to a different system altogether: a single one for text and images that would also treat my mobile visitors better (a third of my total traffic).

Polypager’s strength clearly was in handling the database – it has foreign key capability and without the faintest complaint, Polly will display any mysql-database it is being fed. However, it was never built with serving images as a central part in mind. There is a gallery plugin in place, but my desires soon surpassed the capabilities.

Zenphoto in turn is fantastic in handling text and images (and video by the way, which surprisingly posed the biggest hurdle in wordpress – the other was 301, but in the end Tony McCreath’s redirect generator helped). The problem with zenphoto is more an aesthetic one as the available skins are limited and don’t really meet my expectations. The one I hacked together unfortunately »grew organically« over the years until recently it gracefully started falling apart.

Thus, today I make the move to WordPress and while I am at ease parting from Zenphoto, leaving Polly behind really hurts. So, thanks Nic for developing it and having me aboard, because in the process, I learned many a thing about distinguishing sensible feature requests from the other ones, about version management using svn and git, and also, in 2008, about how it feels to be at the receiving end of a proper hack.

 

.htaccess redirect with GET variable

posted in: Technicalities, www | 0

I wanted to rename a part of this website and I knew, I needed a 301 in order to redirect people from the old to the new address. It was easy to find out that this can be achieved through .htaccess and the basic needs were also pretty easy to gather. Create a text-file called .htaccess on your apache-web-server in the root directory of your website. It needs to contain the following two lines to switch the module on:

RewriteEngine on
RewriteBase /

Then, for the actual rule there’s a lot of generally helpful stuff out there – only it didn’t help me:

  1. the string in question was a GET-variable as part of a dynamic URL
  2. the string could be in the middle of the URL or at the end

My task was to replace a chunk from a dynamic URL and leave unchanged whatever was before or after this chunk.

The example was the page you’re reading at the moment. It used to be called »Recettes« and I wanted to rename it to »Recipes«.

The overview was reached through http://www.brasserie-seul.com/?Recettes, but this article had the URL http://www.brasserie-seul.com/?Recettes&nr=60. In addition this page has groups, so there is also http://www.brasserie-seul.com/?Recettes&group=web, […]group=ubuntu etc.

It took me literally hours of research, until I finally found Carolyn Shelby’s very helpful article. Her code took me almost there:

RewriteCond %{QUERY_STRING} ^(.*)Recettes(.*)$
RewriteRule ^$ Recipes? [R=301,L]
This would take any URL containing the string »Recettes«, no matter where in the url it was, replace it with »Recipes« – and loose everything that followed. Now, Carolyn’s last example contains something she could have been doing if her strings were consistent:

RewriteCond %{QUERY_STRING} ^review=(.*)$
RewriteRule ^cgi-bin/script.cgi$ restaurants/%1? [R=301,L]
The interesting bit here is %1 in the rule, because it apparently represents the (.*) from the condition. In my example I have two (.*)‘s: one before the string, one after. It is Regex for »any character or no characterlaquo. When I figured out that the first (.*) could be addressed through %1 and the second through %2, I was finally there:

RewriteEngine on
RewriteBase...   READ MORE

New Xampp Security Concept

posted in: Technicalities, www | 2

After quite some time I installed xampp again. Everything worked smoothly, only when trying to access phpmyadmin, I was greeted with

New XAMPP security concept:
Access to the requested object is only available from the local network.
This setting

...   READ MORE

Feeds a la Tiny Tiny RSS

posted in: Technicalities, www | 3

[update 2012-10-04] In the meantime, I helped Nic with what he calls scratching some itches for ex-Google-Reader users: we now have gritttt, and gritttt has a) a means to import shared/stared items from g-reader into tt-rss; b) drive-by sharing, meaning you can share any page in tt-rss on the fly; and c) a widget that can display the latest shared items from tt-rss on your website. More here. [/update]

[update 2011-11-10] Both this and Nic’s article have been featured on tt-rss’ project site. There are a bunch of other interesting and useful articles, too, so check it if you’re interested in tt-rss. [/update]

A while ago, Google updated their reader, killing one of the best features: sharing. I looked around a bit for a suitable alternative and in the end settled with tiny, tiny rss.

Advantages:

  1. It runs on my server, so nothing can be done to it unless I approve
  2. Sharing is easy
  3. It’s simple

Nic, who thankfully came up with this great alternative, has

a
...   READ MORE