Masthead
One of my photos

Kindness of strangers

June 26th, 2011 · Posted by Skuds in Life/Technology · 1 Comment · Life, Technology

I have been having a bit of a frustrating time with WordPress lately.

After not writing anything at all for ages – all my recent thoughts have been short enough to fit on Twitter or Facebook – I wrote a post today and when I hit ‘publish’ I did not get the normal message about it working OK, but got a 404 error page instead.  I hit the back button but that only gave me the bare bones of the draft: title only.

This has happened to me before and the last time it was with a really long post and at the time I assumed I had hit the wrong button.  It is a sort of rule of thumb to assume when something happens once it is a cock-up and only when it happens again to start looking for a pattern or reason.

I tried all sorts of things. I even gave in to the nagging from WordPress and upgraded it to the latest version and still the same thing happened.  I wrote a short test post and that worked fine, then tried the larger one again and it failed even though I wrote a far less wordy version than the first attempt.

A bit of Googling came up with this possible explanation.  It did not cheer me up because it described exactly the problem I was getting but the solution involved all sorts of technical stuff to do with mod_security and .htaccess files.

I tried a bit of playing around and looked at my .htaccess file for the first time in ages.  It didn’t look anything like how I remembered it.  Loads more stuff in it.

Anyway, I tried a short post about Glastonbury and that failed, but it was short enough that I could experiment with it and found that one word was causing the problem.  Bizarrely, it was the word “So”, which I am sure I have used before, but I replaced the S with its HTML code and it worked, so at least I had established that this whole mod_security thing was probably the cause.

I tried various suggestions from the web and didn’t really get anywhere.  Then I tweeted in frustration and a total stranger replied with a suggestion that I try going to the permalinks bit of settings in WordPress and save without changing anything.  I think it worked, although it is hard to be 100% certain.  At the moment I am assuming it did.

I think I vaguely understand why it might have worked too.  When you save the permalink settings WordPress writes to the .htaccess file.  I guess other actions in WP might also write to it, which would explain all the stuff in it that I didn’t put there.    I had a little look at the .htaccess file and compared it to the earlier version, which I had a copy of, and there was one section that was different, even though I had not changed any of the settings when I saved, so it is all very feasible.

How nice of Mr Ansley to chip in with a suggestion like that, which seems to have done the trick.

The irony is that he describes himself on his web page as “I am a husband, father, son, brother, believer, and a web developer living in Raleigh, NC” and the post which kicked all this off was one which was not 100% sympathetic to christians.  I feel a little bit bad now.

Tags:

One Comment so far ↓

Leave a Comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

 

 
Comments Policy:

  • Comments from anyone who is unknown (ie who has not commented before) will go into a moderation queue to be approved. This is to prevent spam/advertising comments and there may be a delay before such comments appear.
  • As far as possible I will not reject moderated comments or delete published comments, even if I disagree with them or if they are criticising me.
  • I intend only to delete/reject comments which are offensive, racist, homophobic, sexist or similar or if they are in any way illegal/libellous.
  • If you think a comment meets those criteria and I might have missed it, let me know.
  • Although technically I am able to edit comments I will not do so unless it is to remove embedded code which is causing problems.
  • If it is ever necessary to edit a comment it will be made clear that it has been edited.
  • Certain words in comments will cause the whole comment to be automatically consigned to the dustbin (Aavaisha, hmmegatest, cognitive, phentermine, xanax, pharmacy, viagra, vicodin, casino, ultram, tamiflu, valium, tramadol, levitra, carisoprodol) for obvious reasons.