Tag Archives: wordpress
August 11, 2011

Fixing Permalinks With Mod_Rewrite

I've posted a couple of times about the migration from MovableType to WordPress (and all the other moves that preceded it).

One of the things I discovered via the "Redirection" logs was that I was losing quite a bit of traffic due to some "anomalies" and differences between how the permalinks are currently set and how they'd been when the site was using MovableType.

While I might have wanted people and search engines to always refer to posts using something like:


a lot of them had picked up on the index page, so they'd got:


While that was fine in MovableType and would work fine, it was causing me headaches in WordPress, as that was not how I'd setup the permalinks, nor did I want to set them up that way.

I'd also got a few posts that had a completely different URL structure to the rest of the site, which was odd and quite annoying, but again, as MT stored the posts as actual files it didn't matter too much. In the worst case scenario two versions of the same post might be available - and duplicate content will beat a 404 error any day of the week in my book :)

I tried to fix these anomalies, but while I managed to get various wordpress plugins to fix the bulk of them I was still left with a bunch of errors..

So Niall came to the rescue. He's a bit of a wizard with regular expressions and mod_rewrite

Here's the two rules he added that fixed all my problems (or enough of them to keep me quiet - WordPress' insistence on putting apostrophes back into URLs isn't something I can fix easily!):

RewriteRule ^/blog/archives/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)/ /blog/archives/$1/$2/$4/ [L,R=301]
RewriteRule ^/blog/([0-9]{4})/([0-9]{2})/(.*).html$ /blog/archives/$1/$2/$3/ [L,R=301]

Thanks Niall!

Related Posts:

August 7, 2011

TimThumb Updated To Version 2

Just a headsup if you're using a theme that uses TimThumb.

Due to all the security issues with the plugin / script (it's a single file) the developers issued a number of updates over the last few days which culminated in the release of version 2.

You should also update the file in any themes that are not active OR delete the themes, as the vulnerability is potentially accessible even if the theme isn't active.

You can download the latest version here

Enhanced by Zemanta

Related Posts:

August 3, 2011

Do People Still Use Blogrolls? And Would You Want To Be In Mine?

Image by Mike Licht, NotionsCapital.com

This site started out on Movable Type years ago .. When they changed their licensing I switched to WordPress.. And it was on WordPress for a couple of years.. until it wasn't anymore.

So when I switched it to MovableType back in 2007 the "blogroll" I'd been maintaining disappeared, as MT didn't really have a way of handling it (well it did, but it was messy) so I had a couple of links in a widget and that was it.

Now I'm back using WordPress which ships with the option to publish a "blogroll" or any set of links into the site's sidebar. (I've currently got a very very small one .. )

But is there any point?

Do people actually look at them?

Do people want to be included in them?

If I published one would you want to be included? (Assuming I have some idea who you are and actually want to link to you .. )

Enhanced by Zemanta

Related Posts:

July 11, 2011

A Couple of WordPress Plugins and Tips To Help With Migration

WordPress Logo

Image via Wikipedia

Moving from MovableType to WordPress involves a bit of fiddling about with redirects. How much fiddling you need to do will vary on your setup. In my case my MovableType URL structure was based loosely on a WordPress one, as I'd migrated from WordPress to MovableType previously.

Of course if things were that simple life would be a lot easier - and probably a bit more boring :)

I won't bore you with the details, but suffice to say that "simply" redirecting a couple of things wasn't going to work for all posts .. ..

A couple of plugins that helped resolve this (assuming that it is actually resolved):

Redirection - a very powerful suite that logs 404s so that you can redirect on a per page / post / file basis or setup a solution to catch all the issues

Permalink redirect - handy if you need to update your permalink layout and don't want to lose traffic to the old links

For some reason, possibly the settings I had in my MT install, all comments were set to off on the imported posts. This post has a lot of handy tips on opening comments (or closing them) using MySQL ie. directly running queries on the database. A single SQL query is a lot faster than manually updating hundreds of posts!

WordPress SEO - helps with tweaking your WordPress powered site to maximise the SEO impact

WP Super Cache - One of the things I love about MovableType is that you can set it up to write static files so that no matter how much traffic you're getting Apache can do the heavy-lifting and MySQL only gets involved from time to time. Donncha's plugin suite brings sane caching to WordPress and helps make your site a lot more responsive

Subscribe to Comments Reloaded - while a lot of people seem to like offloading this kind of thing onto a 3rd party service I'm more comfortable running the comment subscriptions directly from my own server.

Enhanced by Zemanta

Related Posts:

July 10, 2011

So Which Theme Is Best?

I'm currently trying to decide which WordPress theme to use on here.

I've been playing around with some of the premium ones from Woothemes and Elegant Themes, but I'm not sure which one to settle on :(

(I'm also trying to work out why some pages are being redirected to the wrong place.. )

Related Posts:

July 10, 2011

Site Revamp (Sort Of)

Due to the lack of ongoing support with MovableType I've decided to move this site back to using WordPress as it's backend.

As I said elsewhere earlier today, I'm still not 100% convinced about WordPress' security etc., but it is being actively developed, which is more than can be said for MovableType.

Moving from MovableType to WordPress is an "interesting" process, so I've documented it and will share my "process" when I get a chance (it's far from perfect!)

If there are broken links or anything on the site at the moment I apologise, but no migration is ever perfect - something will have broken and it will take me some time to fix all the bits that have, unfortunately, broken

Related Posts:

April 25, 2011

Movable Type To WordPress Permalink Oddness

For some bizarre reason the WordPress importer changes the post names from "thing-other-thing" to "thing_other_thing" ie. replacing the dash with an underscore.

The simplest way to fix it is to run a bit of SQL directly on the database:

update wp_posts set post_name = replace(post_name,'_','-');

Thanks to the person who provided the solution here

Related Posts:

April 23, 2011

TimThumb and Zemanta Don’t Play Nice Together

Over the last few days I've been testing a few WordPress themes that use TimThumb for generating thumbnails of both images and video.

TimThumb works very well in most situations, though you can run into the odd issue if your directory permissions aren't correct. In order for it to work it has to have somewhere it can store the thumbnail images.. and that has to be writeable by the server.

However, unless the server you are on has incredibly tight security settings, it's quite easy to "fix" that problem.
But I was still seeing issues on one site where it simply refused to display any thumbnails.
To add to the frustration there were no errors in the logs.

After pulling out some of my hair (I don't have a lot to begin with) I finally realised that the issue was with Zemanta's invisible pixel image.

Removing it from the posts resolved the issue.

Related Posts:

April 14, 2008

Hack Any WordPress Blogs Lately?

I feel sorry for the WordPress developers, but I feel even more sorry for their users.

Over the past year WP users who have been keeping track of updates etc., have had to update and upgrade their installs so many times that it's not funny.

The way I see it WordPress users fall, broadly speaking, into two main categories:

  • Casual users
  • Geeks

Casual users want a CMS to use for their website or blog. They like the way it's easy to install and they've heard good things about it. Lots of webhosts offer easy installers for WordPress.
Lots of designers like working with the WordPress templates.

Neither the casual user or the designer is going to be signed up for security alerts from Secunia or Security Focus  or any of the other security sites.

Geek users are probably more likely to play with stuff and are probably going to install lots of plugins.

Now a hardcore geek might check into the source of a plugin to see if the code is "sane", but the average blog jockey probably isn't that concerned with security.
They're not going to worry about the security holes that CMS with php code in its templates could actually cause.

Why would they?

So WordPress has had security issues in the past.
Surely the latest version resolves all of these?
Surely a major update would bring more than just eye candy?

Seemingly not.
According to Security Focus WP 2.5 is open to SQL injections.
What does that mean in English?
It means, simply, that an evil person could inject data into your blog's database ie. content

There's a longer article discussing some of the implications over here with some back and forth between the author and Mr WordPress - Matt Mullenweg.

In typical fashion Mullenweg tries to attack the author instead of addressing user concerns.

A simple "we aren't aware of any issues" or something along those lines would have been so much more graceful, but no, that was not the case.

I'm no longer a WordPress user, so I can't tell first hand, but is there a glaring big flashing light going off on WP installs if the software is out of date and needs to be upgraded to address security issues? Is there?

Open X has had that for ages. It practically forces you to upgrade as soon as you login to an out of date install. They also don't mind telling users about security holes, instead of adding them as an afterthought.

Now whether or not the latest security hole is a real danger or not is irrelevant. It doesn't matter. Seriously.

What does matter is that people trusted WordPress, but are now being embarrassed when their sites are defaced or hijacked

Transparency and honesty nearly always win out and taking a proactive stance on webapp security should be part and parcel of any developer's modus operandi. Shiny interfaces may help the bubble 2.0 crowd, but when the bubble bursts it would be nice to see things with a proper foundation.

(And WP isn't the only webapp with a dire security history - I'm looking at you Joomla and you PhpBB)

Related Posts:

March 20, 2008

WordPress.com Censoring Blog Content?

I came across this earlier this evening.

I don't use certain types of language in my own writing and have mentioned this more than once in the past, but can a company offering a blog hosting service suspend a site for language use?

Where exactly do you draw the line?

What exactly is "offensive"?

Thoughts on a postcard ....

Related Posts: