Remove the www from URLs

axe.jpgAwhile back, I did a quick tutorial on how to remove the index.html and index.php files from your urls.  I did it because having both in my stats was driving me nuts and causing dupe urls within Google as well.  That splits apart any SEO benefit from inbound links and makes dealing with stats numbers a royal pain.

Another problem is with the www bit in the urls.  I know I’m infamous for point out how folks misuse the www bit this all the time as some networks still have problems resolving urls when an extra layer is added to the domain.

The problem though some people have when setting up such a feature is that they make the with-www or without-www not resolve.  That’s an issue because you’re losing half of the folks don’t use domains the same way you do.

Another problem is that you’re splitting in half any SEO benefit you may get from inbound links.  Some folks will link to your site with the www included, some will not use the ‘www’ bit.  Better to get benefit from all of the inbound links.

Best solution is to redirect visitors to one or the other.  For me, it’s easier to strip out the ‘www’ and try and force it.  You can do that with the following code added to your .htaccess file within root:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]

The domain.com bit needs to be replaced with the correct domain for your site of course.  And you may already have the first line in your .htaccess file.

It would be easier (and require less server load) to make this change within the Apache configuration files but not everybody has access to the root files on a server.

Of course now we’ll have to deal with the no-www and yes-www crowds.

Getting the Comment Form to Display with Movable Type

I have to admit that one of the problems I have had with MovableType is that the comment form does not display on the single post pages. When you look at a post, you have to actually click on a link to get the form to pop up.

A quick google fixed that issue and I’ll copy it below.

What you have to do is edit your mt.js file from within your MT install and comment out the line that includes the following:

hideDocumentElement('comments-form');

Since it’s Javascript two forward slashes at the start of the line will comment it out.

You don’t even have to do a rebuild except for that one file. Takes two seconds.

I hope this helps someone.

Remove index.html and index.php from your URLs

axe.jpgIn additional to having a love hate relationship with my Youtube Video Downloader, I also have a love hate relationship with the statistics that I see on this site.  While I don’t use the index.html bit in the urls within Movable Type, some folks use it when they link to me.  This splits up page views like crazy.  Makes writing up a Most Read Posts post a pain since I have to sit there with a calculator and work out the numbers. (Hmm, I haven’t done one of those in quite a while.)

So anyway, I needed to work out a method of removing the ‘index.html’ bit from the url.  I came up with the following and added it to my htaccess file:

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{THE_REQUEST} \/index.html\ HTTP [NC]
RewriteRule (.*)index.html$ /$1 [R=301,L]

Now the first two lines may already be in your site’s .htaccess file.  If you’re using WordPress, the second line definitely is as it’s required to get pretty permilinks to work.  The third line checks to see if the ‘index.html’ bit is found within the url and the fourth lines removes it but leaves everything else there.

If you’re using WordPress, since you don’t use ‘index.html’ files but ‘index.php’ you need to use the following instead:

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{THE_REQUEST} \/index.php\ HTTP [NC]
RewriteRule (.*)index.php$ /$1 [R=301,L]

Does it work for you?  Here’s a pair of links to a previous post about Mac Wallpapers.  The first link has the index.html bit and while the second does not.  Give it a try.

Mac Desktop Wallpaper
Mac Desktop Wallpaper

Making a few changes, hopefully for the better

Site Under Construction.gif I’ve been sitting here for nearly three hours converting a movie from avi format into something I can burn to a DVD. I’ve been doing it for a local client of mine since he can’t. The annoying part about this is the program I use to convert movie file types maxes out my laptop’s processor so I can’t really do anything else but let the conversion software run.  Lots of fun.

Anyway, I’ve made a number of changes to the blog, hopefully improving things:

  • I’ve fixed a number of broken layout issues that I’ve noticed over time. Had to track down a couple of them but I believe I got them all. I need to make the content area a bit wider though. The older images along side the Google Adsense forces the content text into too narrow of a space.  The lists in the footer got fixed as well as well as the Next and Previous Page links found at the bottom of most pages.  I also changed the permalinks to be the actual title of the content instead of being a separate link.  Have to admit that I found that rather silly, like how Movable Type does their comment links.
  • ShareThis is now found on every Post page.  I had tried it previously on a few, not to much success, but I desided on rolling it out anyway.
  • I’ve turned on gzip on a trial basis. I know that the webpages served are rather large, almost as large as some WordPress blogs I’ve seen. I’ve noticed a drop in the bandwidth used so hopefully that’s an improvement. If you have any issues, please let me know.
  • I’ve reduced the number of posts found on each page from 10 down to 6. Again, the size of the page served was a factor to this but also too much information was being displayed that made it a bit confusing for folks. At least that’s how I felt.
  • Related to that, the category, monthly and daily pages now only show an excerpt of each post, similar to WordPress’ the_excerpt() function. Wish I could leave images in there but I’m not going through the code to fix that.
  • I’ve installed a Related Entries script. Hopefully you’ll see it right after the content on some Posts. Unfortunately this means I have to go back through and retag every single Post here so it may take a bit for folks to see it. If you really want to see it in action, the posts I’ve written about Apple and the iPhone is where I tested it.
  • Oh, I’m just sigh of 1,400 posts so I updated the tag in the header. Comments stand at about 460 in case you’re interested.
  • I’ve made room for a list of Favorite Posts in the footer. Haven’t listed any since after adding that bit in there, I started to give some thought about also putting in a tag cloud down there as well. Something for the next round of fixes I guess.
  • The Category and Monthly pages now have Page Counts in their titles. I did that since Google was complaining about similar titles on many of my pages. That took some fixing of the Paged Archives plugin I installed previously.
  • I fixed a number of 404s and broken links.  Hopefully this will be less of an issue for folks.  I still have a list that I need to go through some time soon.
  • Oh, and I’ve also installed iMT, a Movable Type plugin that allows me to Post from my iPod Touch. Doesn’t allow for more categories than a single one and it won’t allow me to include any photos but it’s there in case I need it.

I think that’s everything.  My notes are kind of messy.  If you see anything broken, please let me know.

How Many Posts Are on Your Front Page?

I find blogging_tips.jpgmyself wondering about this, not only because Problogger asked about it way back when, but because I’m sitting here looking at this site.  One of the features of WordPress is that you can have multiple index pages.  Movable Type doesn’t do that out of the box but it’s a two second fix with Alden Bates’ Paged Archives plugin, a plugin that that I’ve blogged about before.  If you check out the main index page for this site, you should see the links near the bottom of the content column.

It’s not a big change.  I mean we already use category pages as well as monthly ones.  I also have a complete post list, something that WordPress doesn’t do out of the box.  I did a test of 5 Posts on the front page instead of the normal 10 but quickly changed it back.  I hate it when the sidebar is longer than the content.  You’re usually stuck with that on individual post pages unless you normally write a bloody book each and every post.

The image is from Sue’s post about Blogging Tips with EDUBlogs.  It came up when I did a few keyword searches for an images to use on this post.  Maybe we can get her to do an article on the subject.

Damn Spam

damn_spam.png

What’s with all of the trackback spam lately?  That picture to the left there is the count for the last 20 hours or so since my last post.  Add 600 trackbacks that I’ve already deleted as well as the 303 comment spams from the other page and you get 2,886 of those little annoying buggers.  All caught by TypePad AntiSpam of course but then you have to go through and double check them.  At least I hope folks do that like I do.  Would hate to see something get caught by accident.

edit: OK, I found one issue that I fixed.  MT Auto Ban was not configured correctly.  That’s now been fixed and hopefully will be dropping bad IP addresses into the correct block list. (Just in the five minutes I’ve been looking at the plugin, I received 147 more trackbacks that got flagged as spam.) Maybe that’ll give me some breathing room.

How to fix “403 Throttled” errors for trackback pings in Movable Type

For a while now, I’ve been having problems with getting trackbacks sent out of this blog. (Mostly to WordPress blogs using Akismet I’ve noticed but that’s besides the point.) 

I did note a number of times I received a “403 Throttled” error within my activity logs.  A quick google search pulls up this article on Richard Green‘s site on How to fix “403 Throttled” errors for trackback pings in movable type.

Richard tells us to add in the settings OneHourMaxPings and OneDayMaxPings to your site’s /mt/mt-config.cgi file. (I note that as SixApart’s docs don’t actually say where to put those settings.) I’ve gone ahead and placed both lines in my config settings and saved the files.

…And watched the number of spam trackbacks go skyhigh.

Oh well.  At least my trackbacks are going out now.