This is as days pass by, by Stuart Langridge

And this is Stopping spam on my private wiki, written , and concerning Uncategorized

Some fucker spammed my private wiki with loads of links. I suspect it was some kind of spamming robot. Anyway, that’s gotta stop. Fortunately, since it’s a private wiki, I don’t need to leave access open to people. That being the case, what I want to do is enforce authentication on URLs with @edit in them. This is done using the Apache LocationMatch directive: I added the following into the VirtualHost section that defines kryogenix.org in my httpd.conf.
<LocationMatch "wiki/@edit">
 AuthType Basic
AuthName "No spam"
AuthUserFile /var/www/kryogenix.org/html/wiki/.htpasswd
Require valid-user
</LocationMatch>
The really annoying thing is that you can’t use LocationMatch in a .htaccess file. Why? Why does this require me to have root access to edit the main server configuration file? It’s really bloody irritating.

Comments

Sarabian

which is why my wiki has authentication on. I might now switch to pwyky and use this very neat method, thanks.

p.s. the link my private wiki is very very hard to click on because div class=nav sits over the top of div id=content. (isn’t the web developer toolbar useful).

sil

re the PS: I know. Has been a fault of this design since the day I did it, that. It’s why a new design is on the cards (well, that and many other reasons…)

Andy Todd

You could always try turning the pedit configuration option to ‘False’ and then using the javascript bookmarklet from the web site to do your editing. I’m going to try that on my wiki in the next couple of days.

sil

Ah, I assumed that the spam robot was written specifically for pwyky sites. If that’s the case, then having the link hidden won’t help, because it’s still available and therefore a robot can still use it.

This website belongs to Stuart Langridge. Contact details are available. Don't eat yellow snow. Valid HTML5, at least in theory, except for the bits that aren't because I'm that futuristic that I'm ahead of the spec, oh yes. HTML5 help from Bruce Lawson, among others. Fonts from the superb FontSquirrel. End.