Permanent links in WordPress
I don’t like the way of making permanent links in WordPress blogs; there are mainly 2 methods:
- URL indicates date and/or title post, the most popular method, but the problem is funny: I can’t access to my posts through a proxy/firewall stupidly configured, where the words ’sex’, ‘fuck’, ’suck’, … are censored. As I don’t care, write whatever I want and give any title that comes to my mind, I was obliged to switch from this permanent link structure.
- URL indicates the article ID, it’s what I’m using; but recently, I got enough of a Russian spammer who sells pharmaceutic products: They use a loop to get all the posts; as I denied access to comments for those who are not referred from my blog or those who don’t have a valid user agent, their robots track back, and it was very efficient: within 24 hours I got more than 30 comments! Finally, Apache fixed this problem:
Deny From 213.33.239.9
Deny From 213.33.239.9.adsl-spb.net.rol.ru
I know, it’s just a temporary solution, robots will come back (as in Terminator).
What I thought of is the following: adding a column ‘code’ in the database, which represents a unique code that consists of 32 hexadecimal characters; it can for example be the MD5 result of the title combined with the timestamps, a random number, encryption of the milliseconds of the timestamps and uniq function in PHP. I hacked on the wordpress and could figure out about this method, so the URL would be similar to
http://swobodin.fedora-tn.org/?p=f8078f4e6eb081cfb61...
No spammer could guess about this, however, it won’t be standard and I had too many difficulties of migrating wordpress, upgrading the version, etc.
By the way, I tried locally to upgrade my 1.5 version of WP to 2.0.1; all was perfect, except that on some posts, XHTML is not respected, and this is a problem for me. I will look for the problem later when I will have more time.
