26/04/2018

The archive contains older posts which may no longer reflect my current views.

# The more I look at it I'm convinced that the redirect issues are limited to specific posts, and one in particular.

I worked around it by doing things manually in my 404 template using preg_match to identify if the url generating a 404 error matched the old permalink structure:

$erroruri = $_SERVER['REQUEST_URI'];

if ( preg_match('/\/[0-9]{4}\/[0-9]{2}\/[0-9]{2}\/(.*)/i', $erroruri, $match) ) {
    $newurl = "https://colinwalker.blog/" . $match[1];
    header("HTTP/1.1 301 Moved Permanently");
    header("Location: $newurl");
    exit;
}

It works fine but in testing one post (at least that I know of) causes an issue when loaded whether any form of redirect is in place or not, regardless of whether I try to access it via old or new permalink format.

I think I may have to delete and recreate it.

1 comment: click to read or leave your own Comments

# I recreated the problem post and everything appeared okay so set about diving into the database to re-associate comments with the new version.

The problem came back.

It appears that one of the comments on the post had become corrupted somehow and was causing the loop. With this removed I think we're back to normal.

# I found a second corrupted comment on a different post. I don't like the direction this is heading.

2 comments: click to read or leave your own Comments

# Liked: Flashing Palely in the Margins...

"It doesn’t have to be this way, but anyone who is shocked that it is this way, right now, has been willfully ignorant. That ignorance makes everything worse."

This is such a powerful piece on inequality and how being shocked by the unfair treatment of minorities is definitely the wrong reaction.

To be shocked is to ignore that it happens all the time like shootings in the US or knife attacks in London.

Be angry, be disgusted, but don't be shocked or surprised - we're so far past that.

1 comment: click to read or leave your own Comments