Home > BlogTech > Getting the Site Straight

Getting the Site Straight

August 27th, 2007

Man, I have been spending way too much time primping the WordPress stuff on this blog. I am probably going to have to take a break from this for a few weeks while I get other business out of the way. In this post, I just wanted to make a few notes about how a few problems were fixed.

First of all, Japanese in the posts. Apparently, if you install WordPress version 2.2 using “Fantastico” (web hosting CPanel software) or in some other fashions as well, there is a bug in the wp-config.php file, specifically two lines:

define(‘DB_CHARSET’, ‘utf8’);
define(‘DB_COLLATE’, ”);

By deleting these two lines (or putting two slashes at the start of each line to “turn them off”), Japanese will appear fine. I thought I had a deal-breaker when pre-existing smart quotes in other posts suddenly turned to gibberish, only to discover that this new bug only happened in blog posts made after the switch. I simply re-uploaded the stories, and now everything is kosher.

As you might also have noticed, I was finally able to center the calendar. In the stylesheet, under the #wp-calendar heading, I added these two lines:

margin-left: auto;
margin-right: auto;

Apparently, they cause free-sized margins to be created to the left and right of the table, effectively centering it. Frankly, a command like “align: center;” would be a lot easier to figure out….

I have also added a new plug-in, called “On This Day.” It shows blog posts from the same day over past years. It’s smart enough to match the day on individual entry pages as well. One problem I had initially was that the widget showed the day’s posts from the current year as well, something which bugged me to the point of distraction, and I tool it down. But I mentioned this to the widget’s developer… and a few days later he posted a new version with the requested feature of excluding this year’s posts. How’s that for customer service?

I added a “robots.txt” file to ask Google Image to stop scanning my images folder, but that doesn’t erase the thousands of files they’ve cached already, and probably will have there for years to come. Still, you gotta start somewhere.

So far, spam has not been that big a problem. Only one spam has gotten past Askimet, not counting a few that needed Askimet moderation (but did not get to the main moderation area). But the spammers have not yet quite figured out where my main site went yet.

For a long time I have had trouble blocking sites using the .htaccess file. Turns out that I was (for the Nth time) the victim of bad documentation. The best I had been able to get was one site blocked (I used that to block MySpace), but after that, none of the blocks would work. Just today I stumbled upon a web page that actually went to the trouble to explain that if you want to block more than one site, you have to add “,OR” tot he deny rule. I had been writing:

RewriteCond %{HTTP_REFERER} myspace\.com [NC]

…but what I should have been writing was:

RewriteCond %{HTTP_REFERER} myspace\.com [NC,OR]

The “NC” being a command to ignore case, and the “OR” being a note to add another text string to block. Without the “,OR” added, only the first block in the list works. Would it have really killed the authors of the hundred other pages I had depended on previously to make such an obvious and vital note? Sheesh. I also finally figured out that to block access to an image, you had to place the .htaccess file in the directory which has the images to be blocked.

Now I just have to figure out the specific syntax to block any site that has the word “forum” in the URL, and my life will be ten times easier….

Categories: BlogTech Tags: by
  1. August 29th, 2007 at 02:44 | #1

    Do you use the google webmaster tools? You can request that they remove specific link, once you set up a robot.txt file. I imagine that you could remove all your images from their index using their tools

Comments are closed.